summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2024-02-20 16:23:54 -0800
committerGitHub <noreply@github.com>2024-02-20 16:23:54 -0800
commit1c308539756beb576060f492b84b043466109dd3 (patch)
tree752840b5ed064ab3e22500f8d642fe792543d9ca /test
parent60b2daea5467e419899e9201a342cc817d6fd68e (diff)
downloadbinaryen-1c308539756beb576060f492b84b043466109dd3.tar.gz
binaryen-1c308539756beb576060f492b84b043466109dd3.tar.bz2
binaryen-1c308539756beb576060f492b84b043466109dd3.zip
[NFC] Use SubtypingDiscoverer in StringLowering (#6325)
This replaces horrible hacks to find which nulls need to switch (from none to noext) with general code using SubtypingDiscoverer. That helper is aware of where each expression is written, so we can find those nulls trivially. This is NFC on existing usage but should fix any remaining bugs with null constants.
Diffstat (limited to 'test')
-rw-r--r--test/lit/passes/string-lowering-instructions.wast4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/lit/passes/string-lowering-instructions.wast b/test/lit/passes/string-lowering-instructions.wast
index 83a29edfb..550bf81b4 100644
--- a/test/lit/passes/string-lowering-instructions.wast
+++ b/test/lit/passes/string-lowering-instructions.wast
@@ -72,6 +72,7 @@
;; CHECK: (import "colliding" "name" (func $fromCodePoint (type $1)))
(import "colliding" "name" (func $fromCodePoint))
+
;; CHECK: (import "wasm:js-string" "fromCharCodeArray" (func $fromCharCodeArray (type $20) (param (ref null $0) i32 i32) (result (ref extern))))
;; CHECK: (import "wasm:js-string" "fromCodePoint" (func $fromCodePoint_18 (type $21) (param i32) (result (ref extern))))
@@ -88,6 +89,9 @@
;; CHECK: (import "wasm:js-string" "substring" (func $substring (type $25) (param externref i32 i32) (result (ref extern))))
+ ;; CHECK: (global $string externref (ref.null noextern))
+ (global $string stringref (ref.null string)) ;; Test we update global nulls.
+
;; CHECK: (export "export.1" (func $exported-string-returner))
;; CHECK: (export "export.2" (func $exported-string-receiver))