summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2020-02-19 02:06:31 -0800
committerGitHub <noreply@github.com>2020-02-19 02:06:31 -0800
commiteca1a663fead59b2b70271a96abb6793e366b7e6 (patch)
tree6dd931afad2ee031e760c8a54c7647d49a3c17bc /test
parent4b79514283d5f6a4fdd058690b78b3bd97e193b0 (diff)
downloadbinaryen-eca1a663fead59b2b70271a96abb6793e366b7e6.tar.gz
binaryen-eca1a663fead59b2b70271a96abb6793e366b7e6.tar.bz2
binaryen-eca1a663fead59b2b70271a96abb6793e366b7e6.zip
Code pushing support for br_on_exn (#2660)
Like `br_if`, `br_on_exn` is a conditional branch and across which code can be pushed past when conditions are satisfied. Also adds a few lines of comments and NFC changes in a couple places. Changes in Vacuum are NFC because they were being handled in `default:` in the same way anyway, but I added them to be more explicit and consistent with existing code.
Diffstat (limited to 'test')
-rw-r--r--test/passes/code-pushing_all-features.txt17
-rw-r--r--test/passes/code-pushing_all-features.wast14
2 files changed, 31 insertions, 0 deletions
diff --git a/test/passes/code-pushing_all-features.txt b/test/passes/code-pushing_all-features.txt
index 230a9006d..6cb241e26 100644
--- a/test/passes/code-pushing_all-features.txt
+++ b/test/passes/code-pushing_all-features.txt
@@ -94,4 +94,21 @@
)
)
)
+ (func $push-past-br-on-exn (; 4 ;)
+ (local $x i32)
+ (local $y exnref)
+ (drop
+ (block $out (result i32)
+ (drop
+ (br_on_exn $out $e
+ (local.get $y)
+ )
+ )
+ (local.set $x
+ (i32.const 1)
+ )
+ (local.get $x)
+ )
+ )
+ )
)
diff --git a/test/passes/code-pushing_all-features.wast b/test/passes/code-pushing_all-features.wast
index f24456c6d..03debf139 100644
--- a/test/passes/code-pushing_all-features.wast
+++ b/test/passes/code-pushing_all-features.wast
@@ -60,4 +60,18 @@
(drop (local.get $x))
)
)
+
+ (func $push-past-br-on-exn
+ (local $x i32)
+ (local $y exnref)
+ (drop
+ (block $out (result i32)
+ (local.set $x (i32.const 1))
+ (drop
+ (br_on_exn $out $e (local.get $y))
+ )
+ (local.get $x)
+ )
+ )
+ )
)