diff options
author | Heejin Ahn <aheejin@gmail.com> | 2021-06-10 23:44:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-10 23:44:57 -0700 |
commit | ca263c00ec8ff3b7c51d066b273eeee50180091b (patch) | |
tree | 6ee8fa964b5ea8a1dc30cdc1b4e720b6d92d2056 /test | |
parent | 83ae39af1f8ffe67856b16f7ee13de066169b48f (diff) | |
download | binaryen-ca263c00ec8ff3b7c51d066b273eeee50180091b.tar.gz binaryen-ca263c00ec8ff3b7c51d066b273eeee50180091b.tar.bz2 binaryen-ca263c00ec8ff3b7c51d066b273eeee50180091b.zip |
[EH] Allow catch/delegate-less trys (#3924)
This removes the restriction that `try` should have at least one
`catch`/`catch_all`/`delegate`. See WebAssembly/exception-handling#157.
Diffstat (limited to 'test')
-rw-r--r-- | test/exception-handling.wast | 7 | ||||
-rw-r--r-- | test/exception-handling.wast.from-wast | 67 | ||||
-rw-r--r-- | test/exception-handling.wast.fromBinary | 7 | ||||
-rw-r--r-- | test/exception-handling.wast.fromBinary.noDebugInfo | 7 |
4 files changed, 58 insertions, 30 deletions
diff --git a/test/exception-handling.wast b/test/exception-handling.wast index 833010e73..ee5ffbf54 100644 --- a/test/exception-handling.wast +++ b/test/exception-handling.wast @@ -131,6 +131,13 @@ ) ) ) + + ;; try without catch or delegate + (try + (do + (throw $e-i32 (i32.const 0)) + ) + ) ) (func $delegate-test diff --git a/test/exception-handling.wast.from-wast b/test/exception-handling.wast.from-wast index 6d997c521..68034653f 100644 --- a/test/exception-handling.wast.from-wast +++ b/test/exception-handling.wast.from-wast @@ -170,6 +170,13 @@ ) ) ) + (try $try10 + (do + (throw $e-i32 + (i32.const 0) + ) + ) + ) ) (func $delegate-test (try $l0 @@ -180,7 +187,7 @@ ) (delegate $l0) ) - (try $try10 + (try $try11 (do (call $foo) ) @@ -191,24 +198,24 @@ (nop) ) ) - (block $l014 - (try $l011 + (block $l015 + (try $l012 (do - (try $try12 + (try $try13 (do - (br_if $l014 + (br_if $l015 (i32.const 1) ) ) - (delegate $l011) + (delegate $l012) ) - (try $try13 + (try $try14 (do - (br_if $l014 + (br_if $l015 (i32.const 1) ) ) - (delegate $l011) + (delegate $l012) ) ) (catch_all @@ -216,18 +223,18 @@ ) ) ) - (try $l015 + (try $l016 (do - (try $try16 + (try $try17 (do (call $foo) ) - (delegate $l015) + (delegate $l016) ) ) (delegate 0) ) - (try $try17 + (try $try18 (do (nop) ) @@ -251,8 +258,8 @@ (rethrow $l0) ) ) - (block $l019 - (try $l018 + (block $l020 + (try $l019 (do (call $foo) ) @@ -260,14 +267,14 @@ (drop (pop i32) ) - (rethrow $l018) + (rethrow $l019) ) (catch_all - (br $l019) + (br $l020) ) ) ) - (try $l020 + (try $l021 (do (call $foo) ) @@ -280,20 +287,20 @@ (drop (pop i32) ) - (rethrow $l020) + (rethrow $l021) ) (catch_all - (rethrow $l020) + (rethrow $l021) ) ) ) ) - (try $l021 + (try $l022 (do (call $foo) ) (catch_all - (try $try22 + (try $try23 (do (call $foo) ) @@ -302,25 +309,25 @@ (pop i32) ) (block $b0 - (rethrow $l021) + (rethrow $l022) ) ) (catch_all (block $b1 - (rethrow $l021) + (rethrow $l022) ) ) ) ) ) - (try $l023 + (try $l024 (do (call $foo) ) (catch_all - (try $try24 + (try $try25 (do - (rethrow $l023) + (rethrow $l024) ) (catch_all (nop) @@ -328,14 +335,14 @@ ) ) ) - (try $l025 + (try $l026 (do (call $foo) ) (catch_all - (try $try26 + (try $try27 (do - (rethrow $l025) + (rethrow $l026) ) (catch_all (nop) diff --git a/test/exception-handling.wast.fromBinary b/test/exception-handling.wast.fromBinary index 851ec0eb4..ff9a71f28 100644 --- a/test/exception-handling.wast.fromBinary +++ b/test/exception-handling.wast.fromBinary @@ -195,6 +195,13 @@ ) ) ) + (try + (do + (throw $event$0 + (i32.const 0) + ) + ) + ) ) (func $delegate-test (try $label$9 diff --git a/test/exception-handling.wast.fromBinary.noDebugInfo b/test/exception-handling.wast.fromBinary.noDebugInfo index 3ec4a690c..5a0e3331b 100644 --- a/test/exception-handling.wast.fromBinary.noDebugInfo +++ b/test/exception-handling.wast.fromBinary.noDebugInfo @@ -195,6 +195,13 @@ ) ) ) + (try + (do + (throw $event$0 + (i32.const 0) + ) + ) + ) ) (func $3 (try $label$9 |