Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

add a little more complex case with a loop block #325

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions test/core/try_table.wast
Original file line number Diff line number Diff line change
Expand Up @@ -376,3 +376,27 @@
)
"type mismatch"
)

(module
(tag $e (param i32))
(func $dec-and-throw (param i32)
local.get 0
i32.eqz
br_if 0
local.get 0
i32.const 1
i32.sub
throw $e
)
(func $loop (export "loop") (param i32)
local.get 0
loop (param i32)
try_table (param i32) (catch $e 0)
call $dec-and-throw
end
end
)
)

(assert_return (invoke "loop" (i32.const 0)))
(assert_return (invoke "loop" (i32.const 1000000)))
Loading