From 6ba0682c97c818f5ded0c6d2c8be195c022ca81e Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Wed, 8 Sep 2021 15:44:59 +0000 Subject: [PATCH] Bug 1729374 - Add test case for try-delegate bug r=rhunt Depends on D124709 Differential Revision: https://phabricator.services.mozilla.com/D124710 --- .../tests/wasm/exceptions/instructions.js | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/js/src/jit-test/tests/wasm/exceptions/instructions.js b/js/src/jit-test/tests/wasm/exceptions/instructions.js index 2543adff36bb..94c5d98e0ed1 100644 --- a/js/src/jit-test/tests/wasm/exceptions/instructions.js +++ b/js/src/jit-test/tests/wasm/exceptions/instructions.js @@ -1111,6 +1111,31 @@ assertEq( 44 ); +assertEq( + wasmEvalText( + `(module + (tag $exn (param)) + (func $g (param i32) (result i32) (i32.const 42)) + (func (export "f") (result i32) + try (result i32) + try $t + block (result i32) + (i32.const 4) + (call $g) + try + throw $exn + delegate $t + end + drop + end + i32.const 0 + catch_all + i32.const 1 + end))` + ).exports.f(), + 1 +); + // Test delegation to function body. assertEq( wasmEvalText(