summaryrefslogtreecommitdiff
path: root/test/lit/passes/precompute-gc.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/passes/precompute-gc.wast')
-rw-r--r--test/lit/passes/precompute-gc.wast92
1 files changed, 62 insertions, 30 deletions
diff --git a/test/lit/passes/precompute-gc.wast b/test/lit/passes/precompute-gc.wast
index 1c99d6e98..29f64ba07 100644
--- a/test/lit/passes/precompute-gc.wast
+++ b/test/lit/passes/precompute-gc.wast
@@ -125,14 +125,18 @@
;; CHECK-NEXT: (local $x (ref null $struct))
;; CHECK-NEXT: (if
;; CHECK-NEXT: (local.get $i)
- ;; CHECK-NEXT: (local.set $x
- ;; CHECK-NEXT: (struct.new $struct
- ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (then
+ ;; CHECK-NEXT: (local.set $x
+ ;; CHECK-NEXT: (struct.new $struct
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $x
- ;; CHECK-NEXT: (struct.new $struct
- ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (else
+ ;; CHECK-NEXT: (local.set $x
+ ;; CHECK-NEXT: (struct.new $struct
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -147,14 +151,18 @@
;; a merge of two different $x values cannot be precomputed
(if
(local.get $i)
- (local.set $x
- (struct.new $struct
- (i32.const 1)
+ (then
+ (local.set $x
+ (struct.new $struct
+ (i32.const 1)
+ )
)
)
- (local.set $x
- (struct.new $struct
- (i32.const 2)
+ (else
+ (local.set $x
+ (struct.new $struct
+ (i32.const 2)
+ )
)
)
)
@@ -466,8 +474,10 @@
;; CHECK-NEXT: (call $helper
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $tempref
- ;; CHECK-NEXT: (struct.new_default $empty)
+ ;; CHECK-NEXT: (then
+ ;; CHECK-NEXT: (local.set $tempref
+ ;; CHECK-NEXT: (struct.new_default $empty)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.set $tempresult
@@ -494,8 +504,10 @@
(call $helper
(i32.const 0)
)
- (local.set $tempref
- (struct.new $empty)
+ (then
+ (local.set $tempref
+ (struct.new $empty)
+ )
)
)
(local.set $tempresult
@@ -669,8 +681,10 @@
;; CHECK-NEXT: (call $helper
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $tempref
- ;; CHECK-NEXT: (struct.new_default $empty)
+ ;; CHECK-NEXT: (then
+ ;; CHECK-NEXT: (local.set $tempref
+ ;; CHECK-NEXT: (struct.new_default $empty)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.set $stashedref
@@ -702,8 +716,10 @@
(call $helper
(i32.const 0)
)
- (local.set $tempref
- (struct.new $empty)
+ (then
+ (local.set $tempref
+ (struct.new $empty)
+ )
)
)
(local.set $stashedref
@@ -898,8 +914,10 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (if
;; CHECK-NEXT: (local.get $param)
- ;; CHECK-NEXT: (local.set $ref
- ;; CHECK-NEXT: (struct.new_default $empty)
+ ;; CHECK-NEXT: (then
+ ;; CHECK-NEXT: (local.set $ref
+ ;; CHECK-NEXT: (struct.new_default $empty)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
@@ -938,8 +956,10 @@
)
(if
(local.get $param)
- (local.set $ref
- (struct.new $empty)
+ (then
+ (local.set $ref
+ (struct.new $empty)
+ )
)
)
(drop
@@ -1041,7 +1061,9 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (if
;; CHECK-NEXT: (i32.const 1)
- ;; CHECK-NEXT: (unreachable)
+ ;; CHECK-NEXT: (then
+ ;; CHECK-NEXT: (unreachable)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
@@ -1062,7 +1084,9 @@
;; later block.
(if
(i32.const 1)
- (unreachable)
+ (then
+ (unreachable)
+ )
)
(local.get $x)
)
@@ -1105,7 +1129,9 @@
;; CHECK-NEXT: (local $0 (ref any))
;; CHECK-NEXT: (if
;; CHECK-NEXT: (local.get $x)
- ;; CHECK-NEXT: (nop)
+ ;; CHECK-NEXT: (then
+ ;; CHECK-NEXT: (nop)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: (local.set $0
@@ -1126,7 +1152,9 @@
;; Otherwise this is the same as before.
(if
(local.get $x)
- (nop)
+ (then
+ (nop)
+ )
)
(unreachable)
(local.set $0
@@ -1149,7 +1177,9 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (if
;; CHECK-NEXT: (i32.const 1)
- ;; CHECK-NEXT: (unreachable)
+ ;; CHECK-NEXT: (then
+ ;; CHECK-NEXT: (unreachable)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
@@ -1162,7 +1192,9 @@
)
(if
(i32.const 1)
- (unreachable)
+ (then
+ (unreachable)
+ )
)
(local.get $x)
)