asm-with-wasm-off.js 587 Bytes
Newer Older
1 2 3 4
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5
// Flags: --noexpose-wasm --validate-asm --allow-natives-syntax
6

7
// NOTE: This is in its own file because it calls %DisallowCodegenFromStrings,
8 9
// which messes with the isolate's state.
(function testAsmWithWasmOff() {
10
  %DisallowCodegenFromStrings(true);
11 12 13 14 15 16 17 18
  function Module() {
    'use asm';
    function foo() {
      return 0;
    }
    return {foo: foo};
  }
  Module();
19
  assertTrue(%IsAsmWasmCode(Module));
20
})();