summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lit/ctor-eval/multivalue-local.wast65
-rw-r--r--test/lit/help/wasm-ctor-eval.test3
2 files changed, 68 insertions, 0 deletions
diff --git a/test/lit/ctor-eval/multivalue-local.wast b/test/lit/ctor-eval/multivalue-local.wast
new file mode 100644
index 000000000..56dccd624
--- /dev/null
+++ b/test/lit/ctor-eval/multivalue-local.wast
@@ -0,0 +1,65 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+;; RUN: wasm-ctor-eval %s --ctors=multivalue-local --quiet -all -S -o - | filecheck %s
+
+(module
+ ;; CHECK: (type $none_=>_none (func))
+
+ ;; CHECK: (type $none_=>_i32 (func (result i32)))
+
+ ;; CHECK: (import "a" "b" (func $import))
+ (import "a" "b" (func $import))
+
+ (func $multivalue-local (export "multivalue-local") (result i32)
+ (local $0 i32)
+ (local $1 (i32 i32))
+
+ ;; We can eval this line. But we will stop evalling at the line after it, the
+ ;; import call. As a result we'll only have a partial evalling of this
+ ;; function, as a result of which it will begin with sets of the values in the
+ ;; locals, followed by the import call and the rest.
+ (local.set $0
+ (i32.add ;; This add will be evalled into 42.
+ (i32.const 41)
+ (i32.const 1)
+ )
+ )
+ (local.set $1
+ (tuple.make
+ (local.get $0) ;; This will turn into 42.
+ (i32.const 1000)
+ )
+ )
+
+ (call $import)
+
+ ;; Use the locals so they are not trivally removed.
+ (i32.add
+ (local.get $0)
+ (tuple.extract 0
+ (local.get $1)
+ )
+ )
+ )
+)
+;; CHECK: (export "multivalue-local" (func $multivalue-local_0))
+
+;; CHECK: (func $multivalue-local_0 (type $none_=>_i32) (result i32)
+;; CHECK-NEXT: (local $0 i32)
+;; CHECK-NEXT: (local $1 (i32 i32))
+;; CHECK-NEXT: (local.set $0
+;; CHECK-NEXT: (i32.const 42)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (local.set $1
+;; CHECK-NEXT: (tuple.make
+;; CHECK-NEXT: (i32.const 42)
+;; CHECK-NEXT: (i32.const 1000)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (call $import)
+;; CHECK-NEXT: (i32.add
+;; CHECK-NEXT: (local.get $0)
+;; CHECK-NEXT: (tuple.extract 0
+;; CHECK-NEXT: (local.get $1)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
diff --git a/test/lit/help/wasm-ctor-eval.test b/test/lit/help/wasm-ctor-eval.test
index 718249295..34281ea42 100644
--- a/test/lit/help/wasm-ctor-eval.test
+++ b/test/lit/help/wasm-ctor-eval.test
@@ -26,6 +26,9 @@
;; CHECK-NEXT: --ignore-external-input,-ipi Assumes no env vars are to be read, stdin
;; CHECK-NEXT: is empty, etc.
;; CHECK-NEXT:
+;; CHECK-NEXT: --quiet,-q Do not emit verbose logging about the
+;; CHECK-NEXT: eval process
+;; CHECK-NEXT:
;; CHECK-NEXT:
;; CHECK-NEXT: Tool options:
;; CHECK-NEXT: -------------