diff options
Diffstat (limited to 'test/passes')
-rw-r--r-- | test/passes/generate-stack-ir_print-stack-ir_enable-exception-handling.txt | 47 | ||||
-rw-r--r-- | test/passes/generate-stack-ir_print-stack-ir_enable-exception-handling.wast | 19 |
2 files changed, 66 insertions, 0 deletions
diff --git a/test/passes/generate-stack-ir_print-stack-ir_enable-exception-handling.txt b/test/passes/generate-stack-ir_print-stack-ir_enable-exception-handling.txt new file mode 100644 index 000000000..2a9cf6be7 --- /dev/null +++ b/test/passes/generate-stack-ir_print-stack-ir_enable-exception-handling.txt @@ -0,0 +1,47 @@ +(module + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vi (func (param i32))) + (event $e0 (attr 0) (param i32)) + (func $eh (; 0 ;) (type $FUNCSIG$v) + (local $exn exnref) + try + i32.const 0 + throw $e0 + catch + local.set $exn + block $l0 (result i32) + local.get $exn + br_on_exn $l0 $e0 + rethrow + end + drop + end + ) +) +(module + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vi (func (param i32))) + (event $e0 (attr 0) (param i32)) + (func $eh (; 0 ;) (; has Stack IR ;) (type $FUNCSIG$v) + (local $exn exnref) + (try + (throw $e0 + (i32.const 0) + ) + (catch + (local.set $exn + (exnref.pop) + ) + (drop + (block $l0 (result i32) + (rethrow + (br_on_exn $l0 $e0 + (local.get $exn) + ) + ) + ) + ) + ) + ) + ) +) diff --git a/test/passes/generate-stack-ir_print-stack-ir_enable-exception-handling.wast b/test/passes/generate-stack-ir_print-stack-ir_enable-exception-handling.wast new file mode 100644 index 000000000..c355a2bf1 --- /dev/null +++ b/test/passes/generate-stack-ir_print-stack-ir_enable-exception-handling.wast @@ -0,0 +1,19 @@ +(module + (event $e0 (attr 0) (param i32)) + + (func $eh (local $exn exnref) + (try + (throw $e0 (i32.const 0)) + (catch + (local.set $exn (exnref.pop)) + (drop + (block $l0 (result i32) + (rethrow + (br_on_exn $l0 $e0 (local.get $exn)) + ) + ) + ) + ) + ) + ) +) |