summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/memory-control/disabled.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/wasm/memory-control/disabled.js')
-rw-r--r--js/src/jit-test/tests/wasm/memory-control/disabled.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/wasm/memory-control/disabled.js b/js/src/jit-test/tests/wasm/memory-control/disabled.js
new file mode 100644
index 0000000000..48903521db
--- /dev/null
+++ b/js/src/jit-test/tests/wasm/memory-control/disabled.js
@@ -0,0 +1,18 @@
+// |jit-test| skip-if: wasmMemoryControlEnabled()
+
+const { validate } = WebAssembly;
+
+const UNRECOGNIZED_OPCODE = /unrecognized opcode/;
+
+let simpleTests = [
+ "(module (func (memory.discard (i32.const 0) (i32.const 65536))))",
+];
+
+for (let src of simpleTests) {
+ let bin = wasmTextToBinary(src);
+ assertEq(validate(bin), false);
+ wasmCompilationShouldFail(bin, UNRECOGNIZED_OPCODE);
+}
+
+const mem = new WebAssembly.Memory({ initial: 1 });
+assertEq(mem.discard, undefined);