summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lit/passes/simplify-locals-gc.wast24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/lit/passes/simplify-locals-gc.wast b/test/lit/passes/simplify-locals-gc.wast
index 365373c83..6b2b10462 100644
--- a/test/lit/passes/simplify-locals-gc.wast
+++ b/test/lit/passes/simplify-locals-gc.wast
@@ -517,4 +517,28 @@
)
)
)
+
+ ;; CHECK: (func $redundant-tee-finalize (type $anyref_=>_none) (param $x anyref)
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (ref.cast any
+ ;; CHECK-NEXT: (ref.cast any
+ ;; CHECK-NEXT: (local.get $x)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $redundant-tee-finalize (param $x anyref)
+ ;; The tee in the middle will be removed, as it copies a local to itself.
+ ;; After doing so, the outer cast should become non-nullable as we
+ ;; refinalize.
+ (drop
+ (ref.cast null any
+ (local.tee $x
+ (ref.cast any
+ (local.get $x)
+ )
+ )
+ )
+ )
+ )
)