summaryrefslogtreecommitdiff
path: root/test/lit/ctor-eval
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/ctor-eval')
-rw-r--r--test/lit/ctor-eval/string.wast23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/lit/ctor-eval/string.wast b/test/lit/ctor-eval/string.wast
new file mode 100644
index 000000000..916fc2a28
--- /dev/null
+++ b/test/lit/ctor-eval/string.wast
@@ -0,0 +1,23 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+;; RUN: foreach %s %t wasm-ctor-eval --ctors=test --kept-exports=test --quiet -all -S -o - | filecheck %s
+
+;; We should not error on precomputing this string. Nothing should change in
+;; 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))
+
+ (func $test (result anyref)
+ (global.get $global)
+ )
+)
+;; CHECK: (export "test" (func $test_1))
+
+;; CHECK: (func $test_1 (type $0) (result anyref)
+;; CHECK-NEXT: (global.get $global)
+;; CHECK-NEXT: )