diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /js/src/jit-test/tests/wasm/tail-calls/exceptions.js | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/jit-test/tests/wasm/tail-calls/exceptions.js')
-rw-r--r-- | js/src/jit-test/tests/wasm/tail-calls/exceptions.js | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/wasm/tail-calls/exceptions.js b/js/src/jit-test/tests/wasm/tail-calls/exceptions.js new file mode 100644 index 0000000000..fd05f37e53 --- /dev/null +++ b/js/src/jit-test/tests/wasm/tail-calls/exceptions.js @@ -0,0 +1,54 @@ +// |jit-test| --wasm-exceptions; skip-if: !wasmExceptionsEnabled() + +// Simple test with return_call. +var ins = wasmEvalText(`(module + (tag $exn) + (func $f0 (result i32) + throw $exn + ) + (func $f1 (result i32) + try + return_call $f0 + catch $exn + i32.const 3 + return + end + i32.const 4 + ) + (func (export "main") (result i32) + call $f1 + ) +)`); +assertErrorMessage(() => ins.exports.main(), WebAssembly.Exception, /.*/); + +// Test if return stub, created by introducing the slow path, +// not interfering with exception propagation. +var ins0 = wasmEvalText(`(module + (tag $exn) + (func $f0 (result i32) + throw $exn + ) + (func (export "f") (result i32) + call $f0 + ) + (export "t" (tag $exn)) +)`); +var ins = wasmEvalText(`(module + (import "" "t" (tag $exn)) + (import "" "f" (func $f0 (result i32))) + (func $f1 (result i32) + try + return_call $f0 + catch $exn + i32.const 3 + return + end + i32.const 4 + ) + (func (export "main") (result i32) + call $f1 + ) + )`, {"":ins0.exports,}); + +assertErrorMessage(() => ins.exports.main(), WebAssembly.Exception, /.*/); +
\ No newline at end of file |