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.wast13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast
index 6e106ad1b..c2fa16e35 100644
--- a/test/passes/optimize-instructions_all-features.wast
+++ b/test/passes/optimize-instructions_all-features.wast
@@ -4207,8 +4207,17 @@
(unreachable)
)
)
- ;; Tests when if arms are subtype of if's type
- (func $if-arms-subtype (result anyref)
+ ;; These functions test if an `if` with subtyped arms is correctly folded
+ ;; 1. if its `ifTrue` and `ifFalse` arms are identical (can fold)
+ (func $if-arms-subtype-fold (result anyref)
+ (if (result anyref)
+ (i32.const 0)
+ (ref.null extern)
+ (ref.null extern)
+ )
+ )
+ ;; 2. if its `ifTrue` and `ifFalse` arms are not identical (cannot fold)
+ (func $if-arms-subtype-nofold (result anyref)
(if (result anyref)
(i32.const 0)
(ref.null extern)