summaryrefslogtreecommitdiff
path: root/test/lit/passes/roundtrip-gc.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/passes/roundtrip-gc.wast')
-rw-r--r--test/lit/passes/roundtrip-gc.wast29
1 files changed, 17 insertions, 12 deletions
diff --git a/test/lit/passes/roundtrip-gc.wast b/test/lit/passes/roundtrip-gc.wast
index e0b59fe41..2692b7b99 100644
--- a/test/lit/passes/roundtrip-gc.wast
+++ b/test/lit/passes/roundtrip-gc.wast
@@ -8,33 +8,38 @@
;; NOMNL: (export "export" (func $test))
(export "export" (func $test))
;; CHECK: (func $test
+ ;; CHECK-NEXT: (local $0 (ref $\7bi32\7d))
;; CHECK-NEXT: (call $help
- ;; CHECK-NEXT: (struct.new_default $\7bi32\7d)
- ;; CHECK-NEXT: (block $label$1 (result i32)
+ ;; CHECK-NEXT: (block (result (ref $\7bi32\7d))
+ ;; CHECK-NEXT: (local.set $0
+ ;; CHECK-NEXT: (struct.new_default $\7bi32\7d)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: (nop)
- ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; NOMNL: (func $test (type $none_=>_none)
+ ;; NOMNL-NEXT: (local $0 (ref $\7bi32\7d))
;; NOMNL-NEXT: (call $help
- ;; NOMNL-NEXT: (struct.new_default $\7bi32\7d)
- ;; NOMNL-NEXT: (block $label$1 (result i32)
+ ;; NOMNL-NEXT: (block (result (ref $\7bi32\7d))
+ ;; NOMNL-NEXT: (local.set $0
+ ;; NOMNL-NEXT: (struct.new_default $\7bi32\7d)
+ ;; NOMNL-NEXT: )
;; NOMNL-NEXT: (nop)
- ;; NOMNL-NEXT: (i32.const 1)
+ ;; NOMNL-NEXT: (local.get $0)
;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: (i32.const 1)
;; NOMNL-NEXT: )
;; NOMNL-NEXT: )
(func $test
(call $help
(struct.new_default ${i32})
;; Stack IR optimizations can remove this block, leaving a nop in an odd
- ;; "stacky" location. On load, we would normally use a local to work around
- ;; that, creating a block to contain the non-nullable reference before us and
- ;; the nop, and then returning the local. But we can't use a local for a
- ;; non-nullable reference, so we should not optimize this sort of thing in
- ;; stack IR.
- ;; TODO: This shouldn't be true after #4824 is resolved.
+ ;; "stacky" location. On load, we will use a local to work around that. It
+ ;; is fine for the local to be non-nullable since the get is later in that
+ ;; same block.
(block $block (result i32)
(nop)
(i32.const 1)