diff options
Diffstat (limited to 'test/exception-handling.wast.from-wast')
-rw-r--r-- | test/exception-handling.wast.from-wast | 113 |
1 files changed, 94 insertions, 19 deletions
diff --git a/test/exception-handling.wast.from-wast b/test/exception-handling.wast.from-wast index 9fd06c0b1..64d78d54e 100644 --- a/test/exception-handling.wast.from-wast +++ b/test/exception-handling.wast.from-wast @@ -1,10 +1,12 @@ (module (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) - (type $externref_=>_none (func (param externref))) + (type $i64_=>_none (func (param i64))) + (type $i32_i64_=>_none (func (param i32 i64))) (type $exnref_=>_exnref (func (param exnref) (result exnref))) - (event $e0 (attr 0) (param i32)) - (event $e1 (attr 0) (param externref)) + (event $e-i32 (attr 0) (param i32)) + (event $e-i64 (attr 0) (param i64)) + (event $e-i32-i64 (attr 0) (param i32 i64)) (func $exnref_test (param $0 exnref) (result exnref) (local.get $0) ) @@ -15,24 +17,33 @@ (nop) ) (func $eh_test - (local $exn exnref) + (local $x (i32 i64)) (try (do - (throw $e0 + (throw $e-i32 (i32.const 0) ) ) - (catch - (local.set $exn - (pop exnref) + (catch $e-i32 + (drop + (pop i32) + ) + ) + ) + (try + (do + (throw $e-i32-i64 + (i32.const 0) + (i64.const 0) + ) + ) + (catch $e-i32-i64 + (local.set $x + (pop i32 i64) ) (drop - (block $l0 (result i32) - (rethrow - (br_on_exn $l0 $e0 - (local.get $exn) - ) - ) + (tuple.extract 0 + (local.get $x) ) ) ) @@ -42,7 +53,10 @@ (do (br $l1) ) - (catch + (catch $e-i32 + (drop + (pop i32) + ) (br $l1) ) ) @@ -51,9 +65,9 @@ (do (nop) ) - (catch + (catch $e-i32 (drop - (pop exnref) + (pop i32) ) ) ) @@ -62,13 +76,74 @@ (call $foo) (call $bar) ) - (catch + (catch $e-i32 + (drop + (pop i32) + ) + (call $foo) + (call $bar) + ) + ) + (try + (do + (throw $e-i32 + (i32.const 0) + ) + ) + (catch $e-i32 + (drop + (pop i32) + ) + ) + (catch $e-i64 + (drop + (pop i64) + ) + ) + ) + (try + (do + (throw $e-i32 + (i32.const 0) + ) + ) + (catch_all + (nop) + ) + ) + (try + (do + (throw $e-i32 + (i32.const 0) + ) + ) + (catch $e-i32 (drop - (pop exnref) + (pop i32) ) + ) + (catch $e-i64 + (drop + (pop i64) + ) + ) + (catch_all (call $foo) (call $bar) ) ) + (try + (do + (throw $e-i32 + (i32.const 0) + ) + ) + (catch $e-i32 + (drop + (pop i32) + ) + (rethrow 0) + ) + ) ) ) |