summaryrefslogtreecommitdiff
path: root/tests/testdata/run/wasm_unreachable.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testdata/run/wasm_unreachable.js')
-rw-r--r--tests/testdata/run/wasm_unreachable.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/testdata/run/wasm_unreachable.js b/tests/testdata/run/wasm_unreachable.js
new file mode 100644
index 000000000..d6a4f59db
--- /dev/null
+++ b/tests/testdata/run/wasm_unreachable.js
@@ -0,0 +1,9 @@
+// WebAssembly module containing a single function with an unreachable instruction
+const binary = await Deno.readFile("./assets/unreachable.wasm");
+
+const module = new WebAssembly.Module(binary);
+const instance = new WebAssembly.Instance(module);
+
+// Compare the stack trace with wasm_url.js, which compiles the WASM module with
+// streaming APIs.
+instance.exports.unreachable();