Skip to content

Commit 9f65b79

Browse files
committed
add test for EH interaction
1 parent e4f8a1d commit 9f65b79

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

test/spec/return_call_eh.wast

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
;; Test the combination of 'return_call' with exception handling
2+
3+
(module
4+
(tag $t)
5+
6+
(func $test (export "test") (result i32)
7+
(try (result i32)
8+
(do
9+
(call $return-call-in-try)
10+
)
11+
(catch_all
12+
;; Catch the exception thrown from $return-callee
13+
(i32.const 42)
14+
)
15+
)
16+
17+
)
18+
19+
(func $return-call-in-try (result i32)
20+
(try (result i32)
21+
(do
22+
(return_call $return-callee)
23+
)
24+
(catch_all
25+
(unreachable)
26+
)
27+
)
28+
)
29+
30+
(func $return-callee (result i32)
31+
(throw $t)
32+
)
33+
)
34+
35+
(assert_return (invoke "test") (i32.const 42))

0 commit comments

Comments
 (0)