summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lit/passes/optimize-instructions-gc.wast21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/lit/passes/optimize-instructions-gc.wast b/test/lit/passes/optimize-instructions-gc.wast
index abf3da432..c5100434d 100644
--- a/test/lit/passes/optimize-instructions-gc.wast
+++ b/test/lit/passes/optimize-instructions-gc.wast
@@ -3230,4 +3230,25 @@
)
)
)
+
+ ;; CHECK: (func $as_of_unreachable (type $none_=>_ref|data|) (result (ref data))
+ ;; CHECK-NEXT: (ref.as_data
+ ;; CHECK-NEXT: (unreachable)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; NOMNL: (func $as_of_unreachable (type $none_=>_ref|data|) (result (ref data))
+ ;; NOMNL-NEXT: (ref.as_data
+ ;; NOMNL-NEXT: (unreachable)
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: )
+ (func $as_of_unreachable (result (ref data))
+ ;; The cast will definitely fail, so we can turn it into an unreachable. The
+ ;; ref.as must then ignore the unreachable input and not error on trying to
+ ;; infer anything about it.
+ (ref.as_data
+ (ref.cast $A
+ (ref.null none)
+ )
+ )
+ )
)