summaryrefslogtreecommitdiff
path: root/test/lit/help/wasm-metadce.test
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-08-21 15:05:22 -0700
committerGitHub <noreply@github.com>2024-08-21 15:05:22 -0700
commit692e55c14bd3055b1aae49681bb8e62c757c678d (patch)
tree1b25a10166b1cd2dea159f3f59e02dde361a7636 /test/lit/help/wasm-metadce.test
parent99db0d9c7c33bcea7b7730bb5684f41176146f83 (diff)
downloadbinaryen-692e55c14bd3055b1aae49681bb8e62c757c678d.tar.gz
binaryen-692e55c14bd3055b1aae49681bb8e62c757c678d.tar.bz2
binaryen-692e55c14bd3055b1aae49681bb8e62c757c678d.zip
Add a string lowering mode disallowing non-UTF-8 strings (#6861)
The best way to lower strings is via the "magic imports" API that uses the names of imported string globals as their values. This approach only works for valid UTF-8 strings, though. The existing string-lowering-magic-imports pass falls back to putting non-UTF-8 strings in a JSON custom section, but this requires the runtime to support that custom section for correctness. To help catch errors early when runtimes do not support the strings custom section, add a new pass that uses magic imports and raises an error if there are any invalid strings.
Diffstat (limited to 'test/lit/help/wasm-metadce.test')
-rw-r--r--test/lit/help/wasm-metadce.test5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/lit/help/wasm-metadce.test b/test/lit/help/wasm-metadce.test
index c40f2e22b..e25a0214d 100644
--- a/test/lit/help/wasm-metadce.test
+++ b/test/lit/help/wasm-metadce.test
@@ -478,6 +478,11 @@
;; CHECK-NEXT: encodes well-formed strings as
;; CHECK-NEXT: magic imports
;; CHECK-NEXT:
+;; CHECK-NEXT: --string-lowering-magic-imports-assert same as
+;; CHECK-NEXT: string-lowering-magic-imports,
+;; CHECK-NEXT: but raise a fatal error if there
+;; CHECK-NEXT: are invalid strings
+;; CHECK-NEXT:
;; CHECK-NEXT: --strip deprecated; same as strip-debug
;; CHECK-NEXT:
;; CHECK-NEXT: --strip-debug strip debug info (including the