diff options
author | Heejin Ahn <aheejin@gmail.com> | 2021-01-15 18:48:00 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-15 18:48:00 +0900 |
commit | beccdf70258cd99ea25f10af13103e14dc243ffa (patch) | |
tree | 1081d7d350fbab7f901b917f2f082c8d351c3157 /test/reference-types.wast.fromBinary | |
parent | f18c18e01d03d6d293fe3d701408855bbcea58bd (diff) | |
download | binaryen-beccdf70258cd99ea25f10af13103e14dc243ffa.tar.gz binaryen-beccdf70258cd99ea25f10af13103e14dc243ffa.tar.bz2 binaryen-beccdf70258cd99ea25f10af13103e14dc243ffa.zip |
Basic EH instrucion support for the new spec (#3487)
This updates `try`-`catch`-`catch_all` and `rethrow` instructions to
match the new spec. `delegate` is not included. Now `Try` contains not a
single `catchBody` expression but a vector of catch
bodies and events.
This updates most existing routines, optimizations, and tests modulo the
interpreter and the CFG traversal. Because the interpreter has not been
updated yet, the EH spec test is temporarily disabled in check.py. Also,
because the CFG traversal for EH is not yet updated, several EH tests in
`rse_all-features.wast`, which uses CFG traversal, are temporarily
commented out.
Also added a few more tests in existing EH test functions in
test/passes. In the previous spec, `catch` was catching all exceptions
so it was assumed that anything `try` body throws is caught by its
`catch`, but now we can assume the same only if there is a `catch_all`.
Newly added tests test cases when there is a `catch_all` and cases there
are only `catch`es separately.
Diffstat (limited to 'test/reference-types.wast.fromBinary')
-rw-r--r-- | test/reference-types.wast.fromBinary | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/test/reference-types.wast.fromBinary b/test/reference-types.wast.fromBinary index a540048f9..50d403caf 100644 --- a/test/reference-types.wast.fromBinary +++ b/test/reference-types.wast.fromBinary @@ -8,6 +8,7 @@ (type $none_=>_externref (func (result externref))) (type $none_=>_exnref (func (result exnref))) (type $none_=>_none (func)) + (type $i32_=>_none (func (param i32))) (type $externref_=>_funcref (func (param externref) (result funcref))) (import "env" "import_global" (global $import_global externref)) (import "env" "import_func" (func $import_func (param externref) (result funcref))) @@ -22,6 +23,7 @@ (global $global_anyref3 (mut anyref) (ref.null func)) (global $global_anyref4 (mut anyref) (ref.func $foo)) (global $global_anyref5 (mut anyref) (ref.null exn)) + (event $event$0 (attr 0) (param i32)) (export "export_func" (func $import_func)) (export "export_global" (global $import_global)) (func $take_externref (param $0 externref) @@ -700,9 +702,9 @@ (do (local.get $local_funcref) ) - (catch + (catch $event$0 (drop - (pop exnref) + (pop i32) ) (ref.null extern) ) @@ -713,9 +715,9 @@ (do (ref.func $foo) ) - (catch + (catch $event$0 (drop - (pop exnref) + (pop i32) ) (ref.null func) ) @@ -726,8 +728,11 @@ (do (ref.null exn) ) - (catch - (pop exnref) + (catch $event$0 + (drop + (pop i32) + ) + (ref.null exn) ) ) ) @@ -736,9 +741,9 @@ (do (local.get $local_funcref) ) - (catch + (catch $event$0 (drop - (pop exnref) + (pop i32) ) (ref.func $foo) ) @@ -749,8 +754,11 @@ (do (local.get $local_funcref) ) - (catch - (pop exnref) + (catch $event$0 + (drop + (pop i32) + ) + (local.get $local_exnref) ) ) ) @@ -759,9 +767,9 @@ (do (ref.func $foo) ) - (catch + (catch $event$0 (drop - (pop exnref) + (pop i32) ) (local.get $local_funcref) ) @@ -772,8 +780,11 @@ (do (ref.func $foo) ) - (catch - (pop exnref) + (catch $event$0 + (drop + (pop i32) + ) + (local.get $local_exnref) ) ) ) @@ -782,9 +793,9 @@ (do (ref.null exn) ) - (catch + (catch $event$0 (drop - (pop exnref) + (pop i32) ) (local.get $local_funcref) ) @@ -795,9 +806,9 @@ (do (ref.null exn) ) - (catch + (catch $event$0 (drop - (pop exnref) + (pop i32) ) (ref.func $foo) ) |