summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2023-02-21 12:47:09 -0800
committerGitHub <noreply@github.com>2023-02-21 12:47:09 -0800
commita6ae22ca0c5c0f4d5e681d749adc0a2d1bea8861 (patch)
treedf5ea7c1af4cf24cb495f71f6bc9b43759a10166 /test
parentc2f3bbff0d77d3f6ad87a1e47570d4d5d5171284 (diff)
downloadbinaryen-a6ae22ca0c5c0f4d5e681d749adc0a2d1bea8861.tar.gz
binaryen-a6ae22ca0c5c0f4d5e681d749adc0a2d1bea8861.tar.bz2
binaryen-a6ae22ca0c5c0f4d5e681d749adc0a2d1bea8861.zip
[Strings] Add hashing and equality support for strings (#5507)
This is enough to test RSE.
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)
+ )
+ )
)