summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lit/passes/rse-gc.wast49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/lit/passes/rse-gc.wast b/test/lit/passes/rse-gc.wast
index 66b8ee677..c74e92c5e 100644
--- a/test/lit/passes/rse-gc.wast
+++ b/test/lit/passes/rse-gc.wast
@@ -247,4 +247,53 @@
(local.get $nullable)
)
)
+
+ ;; CHECK: (func $string (type $none_=>_none)
+ ;; CHECK-NEXT: (local $s stringref)
+ ;; CHECK-NEXT: (local $t stringref)
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (local.get $s)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $s
+ ;; CHECK-NEXT: (string.const "hello")
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $t
+ ;; CHECK-NEXT: (local.get $s)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (local.get $s)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $t
+ ;; CHECK-NEXT: (string.const "world!")
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $t
+ ;; CHECK-NEXT: (local.get $s)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $string
+ (local $s stringref)
+ (local $t stringref)
+ ;; This set is redundant (both are null).
+ (local.set $t
+ (local.get $s)
+ )
+ (local.set $s
+ (string.const "hello")
+ )
+ ;; This set is not (one is not null).
+ (local.set $t
+ (local.get $s)
+ )
+ ;; This set is redundant (both are "hello").
+ (local.set $t
+ (local.get $s)
+ )
+ (local.set $t
+ (string.const "world!")
+ )
+ ;; This set is not (one is "world!").
+ (local.set $t
+ (local.get $s)
+ )
+ )
)