summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lit/passes/gto-removals.wast33
1 files changed, 31 insertions, 2 deletions
diff --git a/test/lit/passes/gto-removals.wast b/test/lit/passes/gto-removals.wast
index f75eb7483..5dd6ab4d1 100644
--- a/test/lit/passes/gto-removals.wast
+++ b/test/lit/passes/gto-removals.wast
@@ -815,11 +815,13 @@
;; CHECK-NEXT: (block $block
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.as_non_null
- ;; CHECK-NEXT: (block (result (ref null ${mut:i8}))
+ ;; CHECK-NEXT: (block
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (ref.null ${mut:i8})
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (br $block)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (ref.null ${mut:i8})
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -836,6 +838,33 @@
)
)
+ ;; CHECK: (func $unreachable-set-2b (type $none_=>_none)
+ ;; CHECK-NEXT: (nop)
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (ref.as_non_null
+ ;; CHECK-NEXT: (block
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (ref.null ${mut:i8})
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (unreachable)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $unreachable-set-2b
+ ;; As above, but with an unreachable instead of a br. We add a nop here so
+ ;; that we are inside of a block, and then validation would fail if we do
+ ;; not keep the type of the replacement for the struct.set identical to the
+ ;; struct.set. That is, the type must remain unreachable.
+ (nop)
+ (struct.set ${mut:i8} 0
+ (ref.null ${mut:i8})
+ (unreachable)
+ )
+ )
+
;; CHECK: (func $unreachable-set-3 (type $none_=>_none)
;; CHECK-NEXT: (local $0 (ref ${mut:i8}))
;; CHECK-NEXT: (drop