summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGoktug Gokdogan <goktug@google.com>2024-09-04 18:28:49 -0700
committerGitHub <noreply@github.com>2024-09-05 01:28:49 +0000
commitad6a124969a9c6874484f0982c10d6f507388b20 (patch)
tree284a08f66b3a3f5fc5003033eeec27659518040c /test
parent67bd84251222099aae542e3871955824499f514b (diff)
downloadbinaryen-ad6a124969a9c6874484f0982c10d6f507388b20.tar.gz
binaryen-ad6a124969a9c6874484f0982c10d6f507388b20.tar.bz2
binaryen-ad6a124969a9c6874484f0982c10d6f507388b20.zip
Only generate string.consts custom section if it is needed (#6893)
Diffstat (limited to 'test')
-rw-r--r--test/lit/passes/string-lowering_empty.wast22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/lit/passes/string-lowering_empty.wast b/test/lit/passes/string-lowering_empty.wast
new file mode 100644
index 000000000..b00bca9be
--- /dev/null
+++ b/test/lit/passes/string-lowering_empty.wast
@@ -0,0 +1,22 @@
+;; This file checks no custom section added by --string-lowering-magic-imports if there
+;; are is only valid string constants.
+
+(module
+ (func $consts
+ (drop
+ (string.const "foo")
+ )
+ )
+)
+
+;; The custom section should not exist with magic imports.
+;;
+;; RUN: wasm-opt %s --string-lowering-magic-imports -all -S -o - \
+;; RUN: | filecheck %s
+;;
+;; Same behavior when using magic imports with asserts enabled.
+;;
+;; RUN: wasm-opt %s --string-lowering-magic-imports-assert -all -S -o - \
+;; RUN: | filecheck %s
+;;
+;; CHECK-NOT: custom section