summaryrefslogtreecommitdiff
path: root/test/lit/exec/array.wast
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2023-02-14 11:20:25 -0800
committerGitHub <noreply@github.com>2023-02-14 11:20:25 -0800
commit3a315fb8248be7a2a7b7e27ebfde634d05668bf3 (patch)
tree5628b42f655362d9f07e025fe0b52a0528cd3e9d /test/lit/exec/array.wast
parent0fbfedabb9339995a7a8040414aafcc86004b973 (diff)
downloadbinaryen-3a315fb8248be7a2a7b7e27ebfde634d05668bf3.tar.gz
binaryen-3a315fb8248be7a2a7b7e27ebfde634d05668bf3.tar.bz2
binaryen-3a315fb8248be7a2a7b7e27ebfde634d05668bf3.zip
[Wasm GC] Fix array.new order of operand execution (#5487)
Diffstat (limited to 'test/lit/exec/array.wast')
-rw-r--r--test/lit/exec/array.wast20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/lit/exec/array.wast b/test/lit/exec/array.wast
new file mode 100644
index 000000000..7e74c7b7d
--- /dev/null
+++ b/test/lit/exec/array.wast
@@ -0,0 +1,20 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --output=fuzz-exec and should not be edited.
+
+;; RUN: wasm-opt %s -all --fuzz-exec -q -o /dev/null 2>&1 | filecheck %s
+
+(module
+ (type $array (array (mut i8)))
+
+ ;; CHECK: [fuzz-exec] calling func
+ ;; CHECK-NEXT: [fuzz-exec] note result: func => 1
+ (func "func" (result i32)
+ ;; Verifies the order of execution is correct - we should return 1, not 2.
+ (array.new $array
+ (return (i32.const 1))
+ (return (i32.const 2))
+ )
+ )
+)
+;; CHECK: [fuzz-exec] calling func
+;; CHECK-NEXT: [fuzz-exec] note result: func => 1
+;; CHECK-NEXT: [fuzz-exec] comparing func