summaryrefslogtreecommitdiff
path: root/test/lit/ctor-eval/string.wast
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2024-02-05 13:31:41 -0800
committerGitHub <noreply@github.com>2024-02-05 21:31:41 +0000
commita549c5991584038fc3f56df8512b52c1a81fa946 (patch)
treea1f9800498995c00fa1468e18dcbfd53d5786879 /test/lit/ctor-eval/string.wast
parentbe13e0f115c6627b286343368fb125e18d332486 (diff)
downloadbinaryen-a549c5991584038fc3f56df8512b52c1a81fa946.tar.gz
binaryen-a549c5991584038fc3f56df8512b52c1a81fa946.tar.bz2
binaryen-a549c5991584038fc3f56df8512b52c1a81fa946.zip
wasm-ctor-eval: Properly eval strings (#6276)
#6244 tried to do this but was not quite right. It treated a string like an array or a struct, which means create a global for it. But just creating a global isn't enough, as it needs to also be sorted in the right place etc. which requires changes in other places. But there is a much simpler solution here: string constants are just constants, which we can emit in-line, so do that.
Diffstat (limited to 'test/lit/ctor-eval/string.wast')
-rw-r--r--test/lit/ctor-eval/string.wast7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/lit/ctor-eval/string.wast b/test/lit/ctor-eval/string.wast
index 916fc2a28..045c6eec0 100644
--- a/test/lit/ctor-eval/string.wast
+++ b/test/lit/ctor-eval/string.wast
@@ -5,9 +5,6 @@
;; the output, as precomputing a string results in an identical string.
(module
- ;; CHECK: (type $0 (func (result anyref)))
-
- ;; CHECK: (global $global (ref string) (string.const "one"))
(global $global (ref string) (string.const "one"))
(export "test" (func $test))
@@ -16,8 +13,10 @@
(global.get $global)
)
)
+;; CHECK: (type $0 (func (result anyref)))
+
;; CHECK: (export "test" (func $test_1))
;; CHECK: (func $test_1 (type $0) (result anyref)
-;; CHECK-NEXT: (global.get $global)
+;; CHECK-NEXT: (string.const "one")
;; CHECK-NEXT: )