diff options
Diffstat (limited to 'test/exception-handling.wast')
-rw-r--r-- | test/exception-handling.wast | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/test/exception-handling.wast b/test/exception-handling.wast index 63d2bdc3d..cb3aee0d9 100644 --- a/test/exception-handling.wast +++ b/test/exception-handling.wast @@ -1,6 +1,40 @@ (module - (memory 1 1) - (func $exnref_test (param $0 exnref) (result exnref) - (local.get $0) - ) + (event $e0 (attr 0) (param i32)) + + (func $exnref_test (param $0 exnref) (result exnref) + (local.get $0) + ) + + (func $eh_test (local $exn exnref) + (try + (throw $e0 (i32.const 0)) + (catch + ;; Multi-value is not available yet, so block can't take a value from + ;; stack. So this uses locals for now. + (local.set $exn (exnref.pop)) + (drop + (block $l0 (result i32) + (rethrow + (br_on_exn $l0 $e0 (local.get $exn)) + ) + ) + ) + ) + ) + + ;; Try with a block label + (try $l1 + (br $l1) + (catch + (br $l1) + ) + ) + + ;; Empty try body + (try + (catch + (drop (exnref.pop)) + ) + ) + ) ) |