From 356767e259cde364b0968bedf4ffd012d48737b5 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Tue, 28 Feb 2023 18:18:38 -0600 Subject: 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. --- test/lit/array-init-static.wast | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/lit/array-init-static.wast (limited to 'test/lit/array-init-static.wast') 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) + ) + ) + ) +) -- cgit v1.2.3