diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/jit-test/tests/wasm/extended-const/disabled.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/wasm/extended-const/disabled.js b/js/src/jit-test/tests/wasm/extended-const/disabled.js new file mode 100644 index 0000000000..01e64f6c44 --- /dev/null +++ b/js/src/jit-test/tests/wasm/extended-const/disabled.js @@ -0,0 +1,22 @@ +// |jit-test| skip-if: wasmExtendedConstEnabled() + +const { CompileError, validate } = WebAssembly; + +const DISABLED = /extended constant expressions not enabled|unrecognized opcode/; + +let tests = [ + "(module (global i32 i32.const 0 i32.const 0 i32.add))", + "(module (global i32 i32.const 0 i32.const 0 i32.sub))", + "(module (global i32 i32.const 0 i32.const 0 i32.mul))", + "(module (global i64 i64.const 0 i64.const 0 i64.add))", + "(module (global i64 i64.const 0 i64.const 0 i64.sub))", + "(module (global i64 i64.const 0 i64.const 0 i64.mul))", +]; + +// Test that use of extended constants fails when disabled. + +for (let src of tests) { + let bin = wasmTextToBinary(src); + assertEq(validate(bin), false); + wasmCompilationShouldFail(bin, DISABLED); +} |