diff --git a/.github/workflows/ci-interpreter.yml b/.github/workflows/ci-interpreter.yml index 6edfa0c4..297abc7f 100644 --- a/.github/workflows/ci-interpreter.yml +++ b/.github/workflows/ci-interpreter.yml @@ -31,4 +31,4 @@ jobs: - name: Build interpreter run: cd interpreter && opam exec make - name: Run tests - run: cd interpreter && opam exec make JS=node ci + run: cd interpreter && opam exec make JS='node --experimental-wasm-return_call' ci diff --git a/test/core/try_catch.wast b/test/core/try_catch.wast index 6564e201..2a0e9ff6 100644 --- a/test/core/try_catch.wast +++ b/test/core/try_catch.wast @@ -147,6 +147,26 @@ (catch $e0 (i32.const 1)) ) ) + + (func $throw-void (throw $e0)) + (func (export "return-call-in-try-catch") + (try + (do + (return_call $throw-void) + ) + (catch $e0) + ) + ) + + (table funcref (elem $throw-void)) + (func (export "return-call-indirect-in-try-catch") + (try + (do + (return_call_indirect (param) (i32.const 0)) + ) + (catch $e0) + ) + ) ) (assert_return (invoke "empty-catch")) @@ -188,6 +208,9 @@ (assert_return (invoke "catchless-try" (i32.const 0)) (i32.const 0)) (assert_return (invoke "catchless-try" (i32.const 1)) (i32.const 1)) +(assert_exception (invoke "return-call-in-try-catch")) +(assert_exception (invoke "return-call-indirect-in-try-catch")) + (module (func $imported-throw (import "test" "throw")) (tag $e0) diff --git a/test/core/try_delegate.wast b/test/core/try_delegate.wast index 8ee864eb..aae3a301 100644 --- a/test/core/try_delegate.wast +++ b/test/core/try_delegate.wast @@ -115,6 +115,36 @@ (delegate $l3)))) unreachable) (catch_all (i32.const 1)))) + + (func $throw-void (throw $e0)) + (func (export "return-call-in-try-delegate") + (try $l + (do + (try + (do + (return_call $throw-void) + ) + (delegate $l) + ) + ) + (catch $e0) + ) + ) + + (table funcref (elem $throw-void)) + (func (export "return-call-indirect-in-try-delegate") + (try $l + (do + (try + (do + (return_call_indirect (param) (i32.const 0)) + ) + (delegate $l) + ) + ) + (catch $e0) + ) + ) ) (assert_return (invoke "delegate-no-throw") (i32.const 1)) @@ -140,6 +170,9 @@ (assert_return (invoke "delegate-correct-targets") (i32.const 1)) +(assert_exception (invoke "return-call-in-try-delegate")) +(assert_exception (invoke "return-call-indirect-in-try-delegate")) + (assert_malformed (module quote "(module (func (delegate 0)))") "unexpected token"