summaryrefslogtreecommitdiff
path: root/test/lit/array-init-static.wast
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2023-02-28 18:18:38 -0600
committerGitHub <noreply@github.com>2023-02-28 16:18:38 -0800
commit356767e259cde364b0968bedf4ffd012d48737b5 (patch)
tree82daae9ece7114141b31c26a8fcccd94e0ea2ba7 /test/lit/array-init-static.wast
parentaa4bc77bc967fd8911c30d7e69e44a9a0aef553a (diff)
downloadbinaryen-356767e259cde364b0968bedf4ffd012d48737b5.tar.gz
binaryen-356767e259cde364b0968bedf4ffd012d48737b5.tar.bz2
binaryen-356767e259cde364b0968bedf4ffd012d48737b5.zip
Parse and print `array.new_fixed` (#5527)
This is a (more) standard name for `array.init_static`. (The full upstream name in the spec repo is `array.new_canon_fixed`, but I'm still hoping we can drop `canon` from all the instruction names and it doesn't appear elsewhere in Binaryen). Update all the existing tests to use the new name and add a test specifically to ensure the old name continues parsing.
Diffstat (limited to 'test/lit/array-init-static.wast')
-rw-r--r--test/lit/array-init-static.wast29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/lit/array-init-static.wast b/test/lit/array-init-static.wast
new file mode 100644
index 000000000..266a874a6
--- /dev/null
+++ b/test/lit/array-init-static.wast
@@ -0,0 +1,29 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+
+;; RUN: wasm-opt -all %s -S -o - | filecheck %s
+
+;; Check that the deprecated `array.init_static` alias for `array.new_fixed` is
+;; parsed correctly.
+
+(module
+ ;; CHECK: (type $none_=>_none (func))
+
+ ;; CHECK: (type $array (array i32))
+ (type $array (array i32))
+ ;; CHECK: (func $test (type $none_=>_none)
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (array.new_fixed $array
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $test
+ (drop
+ (array.init_static $array
+ (i32.const 0)
+ (i32.const 1)
+ )
+ )
+ )
+)