summaryrefslogtreecommitdiff
path: root/test/lit
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit')
-rw-r--r--test/lit/array-init-static.wast29
-rw-r--r--test/lit/exec/strings.wast2
-rw-r--r--test/lit/heap-types.wast6
-rw-r--r--test/lit/passes/cfp.wast4
-rw-r--r--test/lit/passes/gufa-refs.wast24
-rw-r--r--test/lit/passes/gufa-vs-cfp.wast4
-rw-r--r--test/lit/passes/merge-similar-functions_all-features.wast8
-rw-r--r--test/lit/passes/precompute-gc-immutable.wast8
-rw-r--r--test/lit/passes/type-merging.wast4
-rw-r--r--test/lit/passes/type-ssa.wast30
10 files changed, 74 insertions, 45 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)
+ )
+ )
+ )
+)
diff --git a/test/lit/exec/strings.wast b/test/lit/exec/strings.wast
index 6aa9d7b8a..6d07ae6a8 100644
--- a/test/lit/exec/strings.wast
+++ b/test/lit/exec/strings.wast
@@ -9,7 +9,7 @@
;; CHECK-NEXT: [fuzz-exec] note result: new_wtf16_array => string("ello")
(func "new_wtf16_array" (result stringref)
(string.new_wtf16_array
- (array.init_static $array16
+ (array.new_fixed $array16
(i32.const 104) ;; h
(i32.const 101) ;; e
(i32.const 108) ;; l
diff --git a/test/lit/heap-types.wast b/test/lit/heap-types.wast
index 83926e573..ce7c7814e 100644
--- a/test/lit/heap-types.wast
+++ b/test/lit/heap-types.wast
@@ -117,7 +117,7 @@
(type $vector (array (mut f64)))
;; CHECK: (func $test (type $none_=>_none)
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (array.init_static $vector
+ ;; CHECK-NEXT: (array.new_fixed $vector
;; CHECK-NEXT: (f64.const 1)
;; CHECK-NEXT: (f64.const 2)
;; CHECK-NEXT: (f64.const 4)
@@ -127,7 +127,7 @@
;; CHECK-NEXT: )
;; NOMNL: (func $test (type $none_=>_none)
;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (array.init_static $vector
+ ;; NOMNL-NEXT: (array.new_fixed $vector
;; NOMNL-NEXT: (f64.const 1)
;; NOMNL-NEXT: (f64.const 2)
;; NOMNL-NEXT: (f64.const 4)
@@ -137,7 +137,7 @@
;; NOMNL-NEXT: )
(func $test
(drop
- (array.init_static $vector
+ (array.new_fixed $vector
(f64.const 1)
(f64.const 2)
(f64.const 4)
diff --git a/test/lit/passes/cfp.wast b/test/lit/passes/cfp.wast
index e7ca52e6f..0aeb1f41b 100644
--- a/test/lit/passes/cfp.wast
+++ b/test/lit/passes/cfp.wast
@@ -2076,7 +2076,7 @@
;; CHECK: (type $ref?|$object|_=>_funcref (func (param (ref null $object)) (result funcref)))
- ;; CHECK: (global $global (ref $itable) (array.init_static $itable
+ ;; CHECK: (global $global (ref $itable) (array.new_fixed $itable
;; CHECK-NEXT: (struct.new $vtable
;; CHECK-NEXT: (ref.null nofunc)
;; CHECK-NEXT: )
@@ -2084,7 +2084,7 @@
;; CHECK-NEXT: (ref.func $test)
;; CHECK-NEXT: )
;; CHECK-NEXT: ))
- (global $global (ref $itable) (array.init_static $itable
+ (global $global (ref $itable) (array.new_fixed $itable
(struct.new $vtable
(ref.null func)
)
diff --git a/test/lit/passes/gufa-refs.wast b/test/lit/passes/gufa-refs.wast
index f1ea265d7..995a14fd1 100644
--- a/test/lit/passes/gufa-refs.wast
+++ b/test/lit/passes/gufa-refs.wast
@@ -877,7 +877,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.as_non_null
- ;; CHECK-NEXT: (array.init_static $vector
+ ;; CHECK-NEXT: (array.new_fixed $vector
;; CHECK-NEXT: (f64.const 1.1)
;; CHECK-NEXT: (f64.const 2.2)
;; CHECK-NEXT: )
@@ -905,7 +905,7 @@
)
(drop
(ref.as_non_null
- (array.init_static $vector
+ (array.new_fixed $vector
(f64.const 1.1)
(f64.const 2.2)
)
@@ -3680,14 +3680,14 @@
;; CHECK-NEXT: (local $bytes (ref null $bytes))
;; CHECK-NEXT: (local $chars (ref null $chars))
;; CHECK-NEXT: (local.set $bytes
- ;; CHECK-NEXT: (array.init_static $bytes
+ ;; CHECK-NEXT: (array.new_fixed $bytes
;; CHECK-NEXT: (i31.new
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.set $chars
- ;; CHECK-NEXT: (array.init_static $chars
+ ;; CHECK-NEXT: (array.new_fixed $chars
;; CHECK-NEXT: (ref.null none)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -3719,12 +3719,12 @@
;; which means two things are possible in $chars, and we can't optimize
;; there.
(local.set $bytes
- (array.init_static $bytes
+ (array.new_fixed $bytes
(i31.new (i32.const 0))
)
)
(local.set $chars
- (array.init_static $chars
+ (array.new_fixed $chars
(ref.null any)
)
)
@@ -3765,14 +3765,14 @@
;; CHECK-NEXT: (local $bytes (ref null $bytes))
;; CHECK-NEXT: (local $chars (ref null $chars))
;; CHECK-NEXT: (local.set $bytes
- ;; CHECK-NEXT: (array.init_static $bytes
+ ;; CHECK-NEXT: (array.new_fixed $bytes
;; CHECK-NEXT: (i31.new
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.set $chars
- ;; CHECK-NEXT: (array.init_static $chars
+ ;; CHECK-NEXT: (array.new_fixed $chars
;; CHECK-NEXT: (ref.null none)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -3805,12 +3805,12 @@
(local $bytes (ref null $bytes))
(local $chars (ref null $chars))
(local.set $bytes
- (array.init_static $bytes
+ (array.new_fixed $bytes
(i31.new (i32.const 0))
)
)
(local.set $chars
- (array.init_static $chars
+ (array.new_fixed $chars
(ref.null any)
)
)
@@ -4147,7 +4147,7 @@
;; CHECK: (func $arrays (type $ref|$B|_=>_none) (param $B (ref $B))
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (array.len
- ;; CHECK-NEXT: (array.init_static $B
+ ;; CHECK-NEXT: (array.new_fixed $B
;; CHECK-NEXT: (ref.null none)
;; CHECK-NEXT: (ref.null none)
;; CHECK-NEXT: )
@@ -4157,7 +4157,7 @@
(func $arrays (param $B (ref $B))
(drop
(array.len $B
- (array.init_static $B
+ (array.new_fixed $B
(ref.null none)
(ref.null none)
)
diff --git a/test/lit/passes/gufa-vs-cfp.wast b/test/lit/passes/gufa-vs-cfp.wast
index 3d192bc1f..0a678af4f 100644
--- a/test/lit/passes/gufa-vs-cfp.wast
+++ b/test/lit/passes/gufa-vs-cfp.wast
@@ -2620,7 +2620,7 @@
;; CHECK: (type $none_=>_funcref (func (result funcref)))
- ;; CHECK: (global $global (ref $itable) (array.init_static $itable
+ ;; CHECK: (global $global (ref $itable) (array.new_fixed $itable
;; CHECK-NEXT: (struct.new $vtable
;; CHECK-NEXT: (ref.null nofunc)
;; CHECK-NEXT: )
@@ -2628,7 +2628,7 @@
;; CHECK-NEXT: (ref.func $test)
;; CHECK-NEXT: )
;; CHECK-NEXT: ))
- (global $global (ref $itable) (array.init_static $itable
+ (global $global (ref $itable) (array.new_fixed $itable
(struct.new $vtable
(ref.null func)
)
diff --git a/test/lit/passes/merge-similar-functions_all-features.wast b/test/lit/passes/merge-similar-functions_all-features.wast
index 9d3361e7f..873b6453a 100644
--- a/test/lit/passes/merge-similar-functions_all-features.wast
+++ b/test/lit/passes/merge-similar-functions_all-features.wast
@@ -44,7 +44,7 @@
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: (call $take-ref-null-array
- ;; CHECK-NEXT: (array.init_static $[i8])
+ ;; CHECK-NEXT: (array.new_fixed $[i8])
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $no-call-subtyping-same-operand-0
@@ -52,7 +52,7 @@
(nop) (nop) (nop) (nop) (nop) (nop)
(nop) (nop) (nop) (nop) (nop) (nop)
(call $take-ref-null-array
- (array.init_static $[i8])
+ (array.new_fixed $[i8])
)
)
;; CHECK: (func $no-call-subtyping-same-operand-1 (type $none_=>_none)
@@ -75,7 +75,7 @@
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: (call $take-ref-eq
- ;; CHECK-NEXT: (array.init_static $[i8])
+ ;; CHECK-NEXT: (array.new_fixed $[i8])
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $no-call-subtyping-same-operand-1
@@ -83,7 +83,7 @@
(nop) (nop) (nop) (nop) (nop) (nop)
(nop) (nop) (nop) (nop) (nop) (nop)
(call $take-ref-eq
- (array.init_static $[i8])
+ (array.new_fixed $[i8])
)
)
diff --git a/test/lit/passes/precompute-gc-immutable.wast b/test/lit/passes/precompute-gc-immutable.wast
index 2c03bfa7a..980276ebb 100644
--- a/test/lit/passes/precompute-gc-immutable.wast
+++ b/test/lit/passes/precompute-gc-immutable.wast
@@ -673,11 +673,11 @@
;; CHECK: (type $object (struct (field (ref $vtable))))
(type $object (struct (ref $vtable)))
- ;; CHECK: (global $vtable (ref $vtable) (array.init_static $vtable
+ ;; CHECK: (global $vtable (ref $vtable) (array.new_fixed $vtable
;; CHECK-NEXT: (ref.func $nested-creations)
;; CHECK-NEXT: ))
(global $vtable (ref $vtable)
- (array.init_static $vtable
+ (array.new_fixed $vtable
(ref.func $nested-creations)
)
)
@@ -751,7 +751,7 @@
;; CHECK: (type $vtable-1 (struct (field funcref)))
(type $vtable-1 (struct funcref))
- ;; CHECK: (global $itable (ref $itable) (array.init_static $itable
+ ;; CHECK: (global $itable (ref $itable) (array.new_fixed $itable
;; CHECK-NEXT: (struct.new $vtable-0
;; CHECK-NEXT: (ref.func $nested-creations)
;; CHECK-NEXT: )
@@ -760,7 +760,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: ))
(global $itable (ref $itable)
- (array.init_static $itable
+ (array.new_fixed $itable
(struct.new $vtable-0
(ref.func $nested-creations)
)
diff --git a/test/lit/passes/type-merging.wast b/test/lit/passes/type-merging.wast
index ecdc6f961..ef62c669c 100644
--- a/test/lit/passes/type-merging.wast
+++ b/test/lit/passes/type-merging.wast
@@ -604,7 +604,7 @@
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: (global.get $global$0)
;; CHECK-NEXT: (i64.const 0)
- ;; CHECK-NEXT: (array.init_static $I)
+ ;; CHECK-NEXT: (array.new_fixed $I)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $0 (type $G) (param $0 (ref $C)) (result (ref $D))
@@ -613,7 +613,7 @@
(i32.const 0)
(global.get $global$0)
(i64.const 0)
- (array.init_static $I)
+ (array.new_fixed $I)
)
)
)
diff --git a/test/lit/passes/type-ssa.wast b/test/lit/passes/type-ssa.wast
index abc47901f..ddfe8c089 100644
--- a/test/lit/passes/type-ssa.wast
+++ b/test/lit/passes/type-ssa.wast
@@ -374,75 +374,75 @@
)
)
- ;; CHECK: (func $array.init_static (type $ref|i31|_anyref_=>_none) (param $refined (ref i31)) (param $null-any anyref)
+ ;; CHECK: (func $array.new_fixed (type $ref|i31|_anyref_=>_none) (param $refined (ref i31)) (param $null-any anyref)
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (array.init_static $array$5
+ ;; CHECK-NEXT: (array.new_fixed $array$5
;; CHECK-NEXT: (ref.null none)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (array.init_static $array$6
+ ;; CHECK-NEXT: (array.new_fixed $array$6
;; CHECK-NEXT: (local.get $refined)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (array.init_static $array
+ ;; CHECK-NEXT: (array.new_fixed $array
;; CHECK-NEXT: (local.get $null-any)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (array.init_static $array
+ ;; CHECK-NEXT: (array.new_fixed $array
;; CHECK-NEXT: (local.get $refined)
;; CHECK-NEXT: (local.get $null-any)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $array.init_static (type $ref|i31|_anyref_=>_none) (param $refined (ref i31)) (param $null-any anyref)
+ ;; NOMNL: (func $array.new_fixed (type $ref|i31|_anyref_=>_none) (param $refined (ref i31)) (param $null-any anyref)
;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (array.init_static $array$5
+ ;; NOMNL-NEXT: (array.new_fixed $array$5
;; NOMNL-NEXT: (ref.null none)
;; NOMNL-NEXT: )
;; NOMNL-NEXT: )
;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (array.init_static $array$6
+ ;; NOMNL-NEXT: (array.new_fixed $array$6
;; NOMNL-NEXT: (local.get $refined)
;; NOMNL-NEXT: )
;; NOMNL-NEXT: )
;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (array.init_static $array
+ ;; NOMNL-NEXT: (array.new_fixed $array
;; NOMNL-NEXT: (local.get $null-any)
;; NOMNL-NEXT: )
;; NOMNL-NEXT: )
;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (array.init_static $array
+ ;; NOMNL-NEXT: (array.new_fixed $array
;; NOMNL-NEXT: (local.get $refined)
;; NOMNL-NEXT: (local.get $null-any)
;; NOMNL-NEXT: )
;; NOMNL-NEXT: )
;; NOMNL-NEXT: )
- (func $array.init_static (param $refined (ref i31)) (param $null-any (ref null any))
+ (func $array.new_fixed (param $refined (ref i31)) (param $null-any (ref null any))
;; Null, interesting, so we get a new type.
(drop
- (array.init_static $array
+ (array.new_fixed $array
(ref.null none)
)
)
;; More refined type, interesting.
(drop
- (array.init_static $array
+ (array.new_fixed $array
(local.get $refined)
)
)
;; Same type as declared - boring, no new type.
(drop
- (array.init_static $array
+ (array.new_fixed $array
(local.get $null-any)
)
)
;; Mixture of boring and interesting => boring (since we infer a single type
;; for the entire array).
(drop
- (array.init_static $array
+ (array.new_fixed $array
(local.get $refined)
(local.get $null-any)
)