Skip to content

Commit 58a8e2f

Browse files
authored
[test] Add test for catching same tag with different handlers
1 parent 6e4c4bc commit 58a8e2f

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/core/exceptions/try_table.wast

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,18 @@
253253
(func (export "try-with-param")
254254
(i32.const 0) (try_table (param i32) (drop))
255255
)
256+
257+
(func (export "duplicated-catches") (result i32)
258+
(block
259+
(block
260+
(try_table (catch $e0 0) (catch $e0 1)
261+
(throw $e0)
262+
)
263+
)
264+
(return (i32.const 2))
265+
)
266+
(return (i32.const 3))
267+
)
256268
)
257269

258270
(assert_return (invoke "simple-throw-catch" (i32.const 0)) (i32.const 23))
@@ -312,6 +324,8 @@
312324

313325
(assert_return (invoke "try-with-param"))
314326

327+
(assert_return (invoke "duplicated-catches") (i32.const 2))
328+
315329
(module
316330
(func $imported-throw (import "test" "throw"))
317331
(tag $e0)

0 commit comments

Comments
 (0)