summaryrefslogtreecommitdiff
path: root/test/passes/optimize-instructions_all-features.wast
diff options
context:
space:
mode:
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)
- )
- )
-)