diff --git a/test/core/try_table.wast b/test/core/try_table.wast index 43ae52cc..51599624 100644 --- a/test/core/try_table.wast +++ b/test/core/try_table.wast @@ -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)))