summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2023-07-21 13:12:27 -0700
committerGitHub <noreply@github.com>2023-07-21 13:12:27 -0700
commit84af3482c31bb33595cbb72f30070bc27eab721c (patch)
tree34f71b02d0ab5cc781948668a9cac51bcbb193ef /test
parent794a7ee41068ffe450bf904de504f2cad36d1f21 (diff)
downloadbinaryen-84af3482c31bb33595cbb72f30070bc27eab721c.tar.gz
binaryen-84af3482c31bb33595cbb72f30070bc27eab721c.tar.bz2
binaryen-84af3482c31bb33595cbb72f30070bc27eab721c.zip
SimplifyLocals: Refinalize after removing redundant tees (#5830)
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)
+ )
+ )
+ )
+ )
+ )
)