summaryrefslogtreecommitdiff
path: root/test/passes/optimize-instructions_all-features.wast
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2020-02-05 14:37:53 -0800
committerGitHub <noreply@github.com>2020-02-05 14:37:53 -0800
commit7be22c4d68270573ee010938aa8cd06be89e54d2 (patch)
treeef9607bef85aabb344234484818ffc29f2235919 /test/passes/optimize-instructions_all-features.wast
parent33f92aa06fe5de7bcf9f6b7fe2e74ba5e8e1e782 (diff)
downloadbinaryen-7be22c4d68270573ee010938aa8cd06be89e54d2.tar.gz
binaryen-7be22c4d68270573ee010938aa8cd06be89e54d2.tar.bz2
binaryen-7be22c4d68270573ee010938aa8cd06be89e54d2.zip
Add EH support for OptimizeInstructions (#2608)
- Adds support for `Try` in `optimizeBoolean` function - Adds support for `Try` in `getFallThrough` function - Adds approximate cost values for instructions in EH and reference types proposals.
Diffstat (limited to 'test/passes/optimize-instructions_all-features.wast')
-rw-r--r--test/passes/optimize-instructions_all-features.wast38
1 files changed, 28 insertions, 10 deletions
diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast
index 75993effa..5078e74c5 100644
--- a/test/passes/optimize-instructions_all-features.wast
+++ b/test/passes/optimize-instructions_all-features.wast
@@ -238,6 +238,26 @@
)
(nop)
)
+ (if
+ (try (result i32)
+ (i32.eqz
+ (i32.eqz
+ (i32.const 123)
+ )
+ )
+ (catch
+ (drop
+ (exnref.pop)
+ )
+ (i32.eqz
+ (i32.eqz
+ (i32.const 456)
+ )
+ )
+ )
+ )
+ (nop)
+ )
(drop
(select
(i32.const 101)
@@ -3766,6 +3786,14 @@
(unreachable)
)
)
+ ;; Tests when if arms are subtype of if's type
+ (func $if-arms-subtype (result anyref)
+ (if (result anyref)
+ (i32.const 0)
+ (ref.null)
+ (ref.null)
+ )
+ )
)
(module
(import "env" "memory" (memory $0 (shared 256 256)))
@@ -3783,13 +3811,3 @@
)
)
)
-(module
- ;; Tests when if arms are subtype of if's type
- (func $test (result anyref)
- (if (result anyref)
- (i32.const 0)
- (ref.null)
- (ref.null)
- )
- )
-)