summaryrefslogtreecommitdiff
path: root/test/lit/passes
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/passes')
-rw-r--r--test/lit/passes/cfp-reftest.wast18
-rw-r--r--test/lit/passes/cfp.wast12
-rw-r--r--test/lit/passes/coalesce-locals-gc.wast10
-rw-r--r--test/lit/passes/dae-gc-refine-params.wast24
-rw-r--r--test/lit/passes/dae-gc-refine-return.wast24
-rw-r--r--test/lit/passes/dae_tnh.wast6
-rw-r--r--test/lit/passes/gufa-tnh.wast8
-rw-r--r--test/lit/passes/gufa-vs-cfp.wast18
-rw-r--r--test/lit/passes/local-subtyping.wast4
-rw-r--r--test/lit/passes/monomorphize-context.wast6
-rw-r--r--test/lit/passes/monomorphize-limits.wast8
-rw-r--r--test/lit/passes/monomorphize-types.wast44
-rw-r--r--test/lit/passes/optimize-instructions-gc-iit.wast4
-rw-r--r--test/lit/passes/optimize-instructions-gc.wast20
-rw-r--r--test/lit/passes/simplify-locals-gc.wast10
-rw-r--r--test/lit/passes/string-gathering.wast54
-rw-r--r--test/lit/passes/string-lowering_types.wast16
-rw-r--r--test/lit/passes/type-generalizing.wast20
-rw-r--r--test/lit/passes/type-refining.wast6
-rw-r--r--test/lit/passes/type-ssa-shared.wast6
-rw-r--r--test/lit/passes/type-ssa.wast6
-rw-r--r--test/lit/passes/vacuum-gc.wast4
-rw-r--r--test/lit/passes/vacuum-tnh.wast10
23 files changed, 169 insertions, 169 deletions
diff --git a/test/lit/passes/cfp-reftest.wast b/test/lit/passes/cfp-reftest.wast
index c9fbbdc61..3f903e8b4 100644
--- a/test/lit/passes/cfp-reftest.wast
+++ b/test/lit/passes/cfp-reftest.wast
@@ -122,17 +122,17 @@
(module
;; CHECK: (type $struct (sub (struct (field i32))))
(type $struct (sub (struct i32)))
- ;; CHECK: (type $1 (func))
-
;; CHECK: (type $substruct (sub $struct (struct (field i32) (field f64))))
(type $substruct (sub $struct (struct i32 f64)))
+ ;; CHECK: (type $2 (func))
+
;; CHECK: (type $3 (func (param (ref null $struct)) (result i32)))
;; CHECK: (type $subsubstruct (sub $substruct (struct (field i32) (field f64))))
(type $subsubstruct (sub $substruct (struct i32 f64)))
- ;; CHECK: (func $create (type $1)
+ ;; CHECK: (func $create (type $2)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (struct.new $struct
;; CHECK-NEXT: (i32.const 10)
@@ -421,17 +421,17 @@
(module
;; CHECK: (type $struct (sub (struct (field i32))))
(type $struct (sub (struct i32)))
- ;; CHECK: (type $1 (func))
-
;; CHECK: (type $substruct (sub $struct (struct (field i32) (field f64))))
(type $substruct (sub $struct (struct i32 f64)))
+ ;; CHECK: (type $2 (func))
+
;; CHECK: (type $subsubstruct (sub $substruct (struct (field i32) (field f64) (field anyref))))
(type $subsubstruct (sub $substruct (struct i32 f64 anyref)))
;; CHECK: (type $4 (func (param (ref null $struct)) (result i32)))
- ;; CHECK: (func $create (type $1)
+ ;; CHECK: (func $create (type $2)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (struct.new $struct
;; CHECK-NEXT: (i32.const 10)
@@ -490,17 +490,17 @@
(module
;; CHECK: (type $struct (sub (struct (field i32))))
(type $struct (sub (struct i32)))
- ;; CHECK: (type $1 (func))
-
;; CHECK: (type $substruct (sub $struct (struct (field i32) (field f64))))
(type $substruct (sub $struct (struct i32 f64)))
+ ;; CHECK: (type $2 (func))
+
;; CHECK: (type $subsubstruct (sub $substruct (struct (field i32) (field f64) (field anyref))))
(type $subsubstruct (sub $substruct (struct i32 f64 anyref)))
;; CHECK: (type $4 (func (param (ref null $struct)) (result i32)))
- ;; CHECK: (func $create (type $1)
+ ;; CHECK: (func $create (type $2)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (struct.new $struct
;; CHECK-NEXT: (i32.const 20)
diff --git a/test/lit/passes/cfp.wast b/test/lit/passes/cfp.wast
index cfc8c8d49..d386e7f34 100644
--- a/test/lit/passes/cfp.wast
+++ b/test/lit/passes/cfp.wast
@@ -555,16 +555,16 @@
;; subtype, the get must trap anyhow (the reference it receives can
;; only be null in this closed world).
(module
- ;; CHECK: (type $0 (func))
-
;; CHECK: (type $struct (sub (struct (field i32))))
(type $struct (sub (struct i32)))
;; CHECK: (type $substruct (sub $struct (struct (field i32))))
(type $substruct (sub $struct (struct i32)))
+ ;; CHECK: (type $2 (func))
+
;; CHECK: (type $3 (func (param (ref null $substruct))))
- ;; CHECK: (func $create (type $0)
+ ;; CHECK: (func $create (type $2)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (struct.new $struct
;; CHECK-NEXT: (i32.const 10)
@@ -604,14 +604,14 @@
(module
;; CHECK: (type $struct (sub (struct (field (mut i32)))))
(type $struct (sub (struct (mut i32))))
- ;; CHECK: (type $1 (func (param (ref null $struct))))
-
;; CHECK: (type $substruct (sub $struct (struct (field (mut i32)))))
(type $substruct (sub $struct (struct (mut i32))))
+ ;; CHECK: (type $2 (func (param (ref null $struct))))
+
;; CHECK: (type $3 (func (param (ref null $substruct))))
- ;; CHECK: (func $create (type $1) (param $struct (ref null $struct))
+ ;; CHECK: (func $create (type $2) (param $struct (ref null $struct))
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (struct.new $struct
;; CHECK-NEXT: (i32.const 10)
diff --git a/test/lit/passes/coalesce-locals-gc.wast b/test/lit/passes/coalesce-locals-gc.wast
index 0fc83d74e..d2b6fcaeb 100644
--- a/test/lit/passes/coalesce-locals-gc.wast
+++ b/test/lit/passes/coalesce-locals-gc.wast
@@ -79,7 +79,7 @@
)
)
- ;; CHECK: (func $nn-dead (type $3)
+ ;; CHECK: (func $nn-dead (type $4)
;; CHECK-NEXT: (local $0 funcref)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.func $nn-dead)
@@ -118,7 +118,7 @@
)
)
- ;; CHECK: (func $nn-dead-nameless (type $3)
+ ;; CHECK: (func $nn-dead-nameless (type $4)
;; CHECK-NEXT: (local $0 (ref func))
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.func $nn-dead)
@@ -149,7 +149,7 @@
)
)
- ;; CHECK: (func $unreachable-get-null (type $3)
+ ;; CHECK: (func $unreachable-get-null (type $4)
;; CHECK-NEXT: (local $0 anyref)
;; CHECK-NEXT: (local $1 i31ref)
;; CHECK-NEXT: (unreachable)
@@ -306,9 +306,9 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (global.set $nn-tuple-global
- ;; CHECK-NEXT: (block (type $0) (result (ref any) i32)
+ ;; CHECK-NEXT: (block (type $1) (result (ref any) i32)
;; CHECK-NEXT: (local.set $1
- ;; CHECK-NEXT: (if (type $0) (result (ref any) i32)
+ ;; CHECK-NEXT: (if (type $1) (result (ref any) i32)
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: (then
;; CHECK-NEXT: (tuple.make 2
diff --git a/test/lit/passes/dae-gc-refine-params.wast b/test/lit/passes/dae-gc-refine-params.wast
index 77766e18f..f9e9c4651 100644
--- a/test/lit/passes/dae-gc-refine-params.wast
+++ b/test/lit/passes/dae-gc-refine-params.wast
@@ -19,7 +19,7 @@
(type $"{i32_f32}" (sub $"{i32}" (struct (field i32) (field f32))))
- ;; CHECK: (func $call-various-params-no (type $0)
+ ;; CHECK: (func $call-various-params-no (type $2)
;; CHECK-NEXT: (call $various-params-no
;; CHECK-NEXT: (call $"get_{}")
;; CHECK-NEXT: (call $"get_{i32}")
@@ -45,7 +45,7 @@
)
;; This function is called in ways that do not allow us to alter the types of
;; its parameters (see last function).
- ;; CHECK: (func $various-params-no (type $7) (param $x (ref null $"{}")) (param $y (ref null $"{}"))
+ ;; CHECK: (func $various-params-no (type $8) (param $x (ref null $"{}")) (param $y (ref null $"{}"))
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
@@ -59,7 +59,7 @@
(drop (local.get $y))
)
- ;; CHECK: (func $"get_{}" (type $8) (result (ref null $"{}"))
+ ;; CHECK: (func $"get_{}" (type $9) (result (ref null $"{}"))
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
(func $"get_{}" (result (ref null $"{}"))
@@ -78,7 +78,7 @@
(unreachable)
)
- ;; CHECK: (func $call-various-params-yes (type $0)
+ ;; CHECK: (func $call-various-params-yes (type $2)
;; CHECK-NEXT: (call $various-params-yes
;; CHECK-NEXT: (call $"get_null_{i32}")
;; CHECK-NEXT: (i32.const 0)
@@ -125,7 +125,7 @@
(drop (local.get $y))
)
- ;; CHECK: (func $call-various-params-set (type $0)
+ ;; CHECK: (func $call-various-params-set (type $2)
;; CHECK-NEXT: (call $various-params-set
;; CHECK-NEXT: (call $"get_null_{i32}")
;; CHECK-NEXT: (call $"get_null_{i32}")
@@ -196,7 +196,7 @@
)
)
- ;; CHECK: (func $call-various-params-tee (type $0)
+ ;; CHECK: (func $call-various-params-tee (type $2)
;; CHECK-NEXT: (call $various-params-tee
;; CHECK-NEXT: (call $"get_null_{i32}")
;; CHECK-NEXT: )
@@ -232,7 +232,7 @@
)
)
- ;; CHECK: (func $call-various-params-null (type $0)
+ ;; CHECK: (func $call-various-params-null (type $2)
;; CHECK-NEXT: (call $various-params-null
;; CHECK-NEXT: (ref.as_non_null
;; CHECK-NEXT: (ref.null none)
@@ -286,7 +286,7 @@
(local.set $temp (local.get $temp))
)
- ;; CHECK: (func $call-various-params-middle (type $0)
+ ;; CHECK: (func $call-various-params-middle (type $2)
;; CHECK-NEXT: (call $various-params-middle
;; CHECK-NEXT: (call $"get_null_{i32_i64}")
;; CHECK-NEXT: )
@@ -314,7 +314,7 @@
(drop (local.get $x))
)
- ;; CHECK: (func $unused-and-refinable (type $0)
+ ;; CHECK: (func $unused-and-refinable (type $2)
;; CHECK-NEXT: (local $0 structref)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: )
@@ -330,7 +330,7 @@
;; local).
)
- ;; CHECK: (func $call-unused-and-refinable (type $0)
+ ;; CHECK: (func $call-unused-and-refinable (type $2)
;; CHECK-NEXT: (call $unused-and-refinable)
;; CHECK-NEXT: )
(func $call-unused-and-refinable
@@ -357,7 +357,7 @@
)
)
- ;; CHECK: (func $call-non-nullable-fixup (type $0)
+ ;; CHECK: (func $call-non-nullable-fixup (type $2)
;; CHECK-NEXT: (call $non-nullable-fixup
;; CHECK-NEXT: (struct.new_default $"{}")
;; CHECK-NEXT: )
@@ -368,7 +368,7 @@
)
)
- ;; CHECK: (func $call-update-null (type $0)
+ ;; CHECK: (func $call-update-null (type $2)
;; CHECK-NEXT: (call $update-null
;; CHECK-NEXT: (ref.null none)
;; CHECK-NEXT: )
diff --git a/test/lit/passes/dae-gc-refine-return.wast b/test/lit/passes/dae-gc-refine-return.wast
index 1088cda25..abc1154da 100644
--- a/test/lit/passes/dae-gc-refine-return.wast
+++ b/test/lit/passes/dae-gc-refine-return.wast
@@ -20,7 +20,7 @@
(table 1 1 funcref)
;; We cannot refine the return type if nothing is actually returned.
- ;; CHECK: (func $refine-return-no-return (type $2) (result anyref)
+ ;; CHECK: (func $refine-return-no-return (type $0) (result anyref)
;; CHECK-NEXT: (local $temp anyref)
;; CHECK-NEXT: (local.set $temp
;; CHECK-NEXT: (call $refine-return-no-return)
@@ -37,7 +37,7 @@
)
;; We cannot refine the return type if it is already the best it can be.
- ;; CHECK: (func $refine-return-no-refining (type $2) (result anyref)
+ ;; CHECK: (func $refine-return-no-refining (type $0) (result anyref)
;; CHECK-NEXT: (local $temp anyref)
;; CHECK-NEXT: (local $any anyref)
;; CHECK-NEXT: (local.set $temp
@@ -170,7 +170,7 @@
(local.get $i31)
)
- ;; CHECK: (func $refine-return-many-lub (type $5) (result eqref)
+ ;; CHECK: (func $refine-return-many-lub (type $7) (result eqref)
;; CHECK-NEXT: (local $temp anyref)
;; CHECK-NEXT: (local $i31 i31ref)
;; CHECK-NEXT: (local $struct structref)
@@ -218,7 +218,7 @@
(local.get $i31)
)
- ;; CHECK: (func $refine-return-many-lub-2 (type $5) (result eqref)
+ ;; CHECK: (func $refine-return-many-lub-2 (type $7) (result eqref)
;; CHECK-NEXT: (local $temp anyref)
;; CHECK-NEXT: (local $i31 i31ref)
;; CHECK-NEXT: (local $struct structref)
@@ -267,7 +267,7 @@
)
;; We can refine the return types of tuples.
- ;; CHECK: (func $refine-return-tuple (type $6) (result i31ref i32)
+ ;; CHECK: (func $refine-return-tuple (type $8) (result i31ref i32)
;; CHECK-NEXT: (local $temp anyref)
;; CHECK-NEXT: (local $i31 i31ref)
;; CHECK-NEXT: (local.set $temp
@@ -300,13 +300,13 @@
;; returns a ref.func of this one. They both begin by returning a funcref;
;; after refining the return type of the second function, it will have a more
;; specific type (which is ok as subtyping is allowed with tail calls).
- ;; CHECK: (func $do-return-call (type $7) (result funcref)
+ ;; CHECK: (func $do-return-call (type $6) (result funcref)
;; CHECK-NEXT: (return_call $return-ref-func)
;; CHECK-NEXT: )
(func $do-return-call (result funcref)
(return_call $return-ref-func)
)
- ;; CHECK: (func $return-ref-func (type $9) (result (ref $7))
+ ;; CHECK: (func $return-ref-func (type $9) (result (ref $6))
;; CHECK-NEXT: (ref.func $do-return-call)
;; CHECK-NEXT: )
(func $return-ref-func (result funcref)
@@ -329,7 +329,7 @@
;; target's return type is more specific than anyref.
(return_call $tail-callee)
)
- ;; CHECK: (func $tail-caller-no (type $2) (result anyref)
+ ;; CHECK: (func $tail-caller-no (type $0) (result anyref)
;; CHECK-NEXT: (local $any anyref)
;; CHECK-NEXT: (if
;; CHECK-NEXT: (i32.const 1)
@@ -386,7 +386,7 @@
(func $tail-caller-indirect-yes (result anyref)
(return_call_indirect (type $"return_{}") (i32.const 0))
)
- ;; CHECK: (func $tail-caller-indirect-no (type $2) (result anyref)
+ ;; CHECK: (func $tail-caller-indirect-no (type $0) (result anyref)
;; CHECK-NEXT: (local $any anyref)
;; CHECK-NEXT: (if
;; CHECK-NEXT: (i32.const 1)
@@ -445,7 +445,7 @@
(return_call_ref $"return_{}" (local.get $"return_{}"))
)
- ;; CHECK: (func $tail-caller-call_ref-no (type $2) (result anyref)
+ ;; CHECK: (func $tail-caller-call_ref-no (type $0) (result anyref)
;; CHECK-NEXT: (local $any anyref)
;; CHECK-NEXT: (local $"return_{}" (ref null $"return_{}"))
;; CHECK-NEXT: (if
@@ -471,7 +471,7 @@
)
(return_call_ref $"return_{}" (local.get $"return_{}"))
)
- ;; CHECK: (func $tail-caller-call_ref-unreachable (type $2) (result anyref)
+ ;; CHECK: (func $tail-caller-call_ref-unreachable (type $0) (result anyref)
;; CHECK-NEXT: (block ;; (replaces unreachable CallRef we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
@@ -554,7 +554,7 @@
)
)
- ;; CHECK: (func $call-update-null (type $2) (result anyref)
+ ;; CHECK: (func $call-update-null (type $0) (result anyref)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (call $update-null
;; CHECK-NEXT: (i32.const 0)
diff --git a/test/lit/passes/dae_tnh.wast b/test/lit/passes/dae_tnh.wast
index 6d75aed30..2bba6570b 100644
--- a/test/lit/passes/dae_tnh.wast
+++ b/test/lit/passes/dae_tnh.wast
@@ -3,14 +3,14 @@
;; RUN: foreach %s %t wasm-opt --dae --all-features -tnh -S -o - | filecheck %s
(module
- ;; CHECK: (type $0 (func))
-
;; CHECK: (type $struct (sub (struct (field i32))))
(type $struct (sub (struct (field i32))))
+ ;; CHECK: (type $1 (func))
+
;; CHECK: (type $2 (func (param (ref null $struct))))
- ;; CHECK: (func $target (type $0)
+ ;; CHECK: (func $target (type $1)
;; CHECK-NEXT: (local $0 i32)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: )
diff --git a/test/lit/passes/gufa-tnh.wast b/test/lit/passes/gufa-tnh.wast
index ecf031bbf..e645c4560 100644
--- a/test/lit/passes/gufa-tnh.wast
+++ b/test/lit/passes/gufa-tnh.wast
@@ -1978,17 +1978,17 @@
;; Control flow around calls.
(module
- ;; CHECK: (type $0 (func))
-
;; CHECK: (type $A (sub (struct)))
(type $A (sub (struct)))
+ ;; CHECK: (type $1 (func))
+
;; CHECK: (type $B (sub $A (struct)))
(type $B (sub $A (struct)))
;; CHECK: (type $3 (func (param (ref null $A))))
- ;; CHECK: (import "a" "b" (func $import-throw (type $0)))
+ ;; CHECK: (import "a" "b" (func $import-throw (type $1)))
(import "a" "b" (func $import-throw))
;; CHECK: (export "a" (func $caller))
@@ -2013,7 +2013,7 @@
)
)
- ;; CHECK: (func $caller (type $0)
+ ;; CHECK: (func $caller (type $1)
;; CHECK-NEXT: (call $called
;; CHECK-NEXT: (struct.new_default $B)
;; CHECK-NEXT: )
diff --git a/test/lit/passes/gufa-vs-cfp.wast b/test/lit/passes/gufa-vs-cfp.wast
index 45f111cb2..4e64ed350 100644
--- a/test/lit/passes/gufa-vs-cfp.wast
+++ b/test/lit/passes/gufa-vs-cfp.wast
@@ -1145,6 +1145,8 @@
;; different values in the sub-most type. Create the top and bottom types, but
;; not the middle one.
(module
+ ;; CHECK: (type $0 (func))
+
;; CHECK: (type $struct1 (sub (struct (field i32) (field i32))))
(type $struct1 (sub (struct i32 i32)))
@@ -1154,8 +1156,6 @@
;; CHECK: (type $struct3 (sub $struct2 (struct (field i32) (field i32) (field f64) (field f64) (field anyref) (field anyref))))
(type $struct3 (sub $struct2 (struct i32 i32 f64 f64 anyref anyref)))
- ;; CHECK: (type $3 (func))
-
;; CHECK: (type $4 (func (result anyref)))
;; CHECK: (type $5 (func (result (ref $struct1))))
@@ -1200,7 +1200,7 @@
)
)
- ;; CHECK: (func $get-1 (type $3)
+ ;; CHECK: (func $get-1 (type $0)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block (result i32)
;; CHECK-NEXT: (drop
@@ -1235,7 +1235,7 @@
)
)
- ;; CHECK: (func $get-2 (type $3)
+ ;; CHECK: (func $get-2 (type $0)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block (result i32)
;; CHECK-NEXT: (drop
@@ -1295,7 +1295,7 @@
)
)
- ;; CHECK: (func $get-3 (type $3)
+ ;; CHECK: (func $get-3 (type $0)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block (result i32)
;; CHECK-NEXT: (drop
@@ -2027,6 +2027,8 @@
;; sets, and the final subtype C has a create and a get. The set to A should
;; apply to it, preventing optimization.
(module
+ ;; CHECK: (type $0 (func))
+
;; CHECK: (type $A (sub (struct (field (mut i32)))))
(type $A (sub (struct (mut i32))))
@@ -2036,8 +2038,6 @@
;; CHECK: (type $C (sub $B (struct (field (mut i32)))))
(type $C (sub $B (struct (mut i32))))
- ;; CHECK: (type $3 (func))
-
;; CHECK: (type $4 (func (result (ref $C))))
;; CHECK: (func $create-C (type $4) (result (ref $C))
@@ -2050,7 +2050,7 @@
(i32.const 10)
)
)
- ;; CHECK: (func $set (type $3)
+ ;; CHECK: (func $set (type $0)
;; CHECK-NEXT: (struct.set $C 0
;; CHECK-NEXT: (ref.cast (ref $C)
;; CHECK-NEXT: (call $create-C)
@@ -2071,7 +2071,7 @@
(i32.const 20) ;; different value than in $create
)
)
- ;; CHECK: (func $get (type $3)
+ ;; CHECK: (func $get (type $0)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (struct.get $C 0
;; CHECK-NEXT: (call $create-C)
diff --git a/test/lit/passes/local-subtyping.wast b/test/lit/passes/local-subtyping.wast
index 2985102e1..922d350c5 100644
--- a/test/lit/passes/local-subtyping.wast
+++ b/test/lit/passes/local-subtyping.wast
@@ -21,7 +21,7 @@
;; CHECK: (import "out" "i32" (func $i32 (type $1) (result i32)))
(import "out" "i32" (func $i32 (result i32)))
- ;; CHECK: (import "out" "i64" (func $i64 (type $6) (result i64)))
+ ;; CHECK: (import "out" "i64" (func $i64 (type $4) (result i64)))
(import "out" "i64" (func $i64 (result i64)))
;; CHECK: (tag $e-anyref (param anyref))
@@ -210,7 +210,7 @@
;; Sometimes a refinalize is necessary in between the iterations.
;; CHECK: (func $multiple-iterations-refinalize (type $2) (param $i i32)
;; CHECK-NEXT: (local $x (ref $1))
- ;; CHECK-NEXT: (local $y (ref $6))
+ ;; CHECK-NEXT: (local $y (ref $4))
;; CHECK-NEXT: (local $z (ref func))
;; CHECK-NEXT: (local.set $x
;; CHECK-NEXT: (ref.func $i32)
diff --git a/test/lit/passes/monomorphize-context.wast b/test/lit/passes/monomorphize-context.wast
index e4391d3a5..cc4bdfc9d 100644
--- a/test/lit/passes/monomorphize-context.wast
+++ b/test/lit/passes/monomorphize-context.wast
@@ -954,8 +954,6 @@
;; CAREFUL-NEXT: )
(module
;; ALWAYS: (type $struct (struct (field i16) (field (mut i8)) (field (mut f64))))
- ;; CAREFUL: (type $0 (func))
-
;; CAREFUL: (type $struct (struct (field i16) (field (mut i8)) (field (mut f64))))
(type $struct (struct (field i16) (field (mut i8)) (field (mut f64))))
@@ -973,11 +971,13 @@
;; ALWAYS-NEXT: (local.get $f64)
;; ALWAYS-NEXT: )
;; ALWAYS-NEXT: )
+ ;; CAREFUL: (type $1 (func))
+
;; CAREFUL: (type $2 (func (param (ref $struct))))
;; CAREFUL: (type $3 (func (param i32 f64)))
- ;; CAREFUL: (func $caller (type $0)
+ ;; CAREFUL: (func $caller (type $1)
;; CAREFUL-NEXT: (local $i32 i32)
;; CAREFUL-NEXT: (local $f64 f64)
;; CAREFUL-NEXT: (call $target_2
diff --git a/test/lit/passes/monomorphize-limits.wast b/test/lit/passes/monomorphize-limits.wast
index 7b3baee5e..344f55b51 100644
--- a/test/lit/passes/monomorphize-limits.wast
+++ b/test/lit/passes/monomorphize-limits.wast
@@ -235,8 +235,6 @@
;; CAREFUL-NEXT: )
(module
;; ALWAYS: (type $array (array (mut i32)))
- ;; CAREFUL: (type $0 (func))
-
;; CAREFUL: (type $array (array (mut i32)))
(type $array (array (mut i32)))
@@ -249,11 +247,13 @@
;; ALWAYS: (func $caller-consts (type $1)
;; ALWAYS-NEXT: (call $target_3)
;; ALWAYS-NEXT: )
+ ;; CAREFUL: (type $1 (func))
+
;; CAREFUL: (type $2 (func (param i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)))
;; CAREFUL: (type $3 (func (param (ref $array))))
- ;; CAREFUL: (func $caller-consts (type $0)
+ ;; CAREFUL: (func $caller-consts (type $1)
;; CAREFUL-NEXT: (call $target_3)
;; CAREFUL-NEXT: )
(func $caller-consts
@@ -395,6 +395,6 @@
;; ALWAYS-NEXT: (nop)
;; ALWAYS-NEXT: )
-;; CAREFUL: (func $target_3 (type $0)
+;; CAREFUL: (func $target_3 (type $1)
;; CAREFUL-NEXT: (nop)
;; CAREFUL-NEXT: )
diff --git a/test/lit/passes/monomorphize-types.wast b/test/lit/passes/monomorphize-types.wast
index 863ccc086..d0cd4edc2 100644
--- a/test/lit/passes/monomorphize-types.wast
+++ b/test/lit/passes/monomorphize-types.wast
@@ -11,24 +11,24 @@
;; ALWAYS: (type $A (sub (struct)))
;; CAREFUL: (type $A (sub (struct)))
(type $A (sub (struct)))
- ;; ALWAYS: (type $1 (func (param (ref $A))))
-
;; ALWAYS: (type $B (sub $A (struct)))
- ;; CAREFUL: (type $1 (func (param (ref $A))))
-
;; CAREFUL: (type $B (sub $A (struct)))
(type $B (sub $A (struct)))
+ ;; ALWAYS: (type $2 (func (param (ref $A))))
+
;; ALWAYS: (type $3 (func (param (ref $B))))
;; ALWAYS: (type $4 (func (param (ref $A) (ref $B))))
- ;; ALWAYS: (import "a" "b" (func $import (type $1) (param (ref $A))))
+ ;; ALWAYS: (import "a" "b" (func $import (type $2) (param (ref $A))))
+ ;; CAREFUL: (type $2 (func (param (ref $A))))
+
;; CAREFUL: (type $3 (func (param (ref $A) (ref $B))))
;; CAREFUL: (type $4 (func (param (ref $B))))
- ;; CAREFUL: (import "a" "b" (func $import (type $1) (param (ref $A))))
+ ;; CAREFUL: (import "a" "b" (func $import (type $2) (param (ref $A))))
(import "a" "b" (func $import (param (ref $A))))
;; ALWAYS: (func $calls (type $4) (param $A (ref $A)) (param $B (ref $B))
@@ -96,12 +96,12 @@
)
)
- ;; ALWAYS: (func $refinable (type $1) (param $ref (ref $A))
+ ;; ALWAYS: (func $refinable (type $2) (param $ref (ref $A))
;; ALWAYS-NEXT: (drop
;; ALWAYS-NEXT: (local.get $ref)
;; ALWAYS-NEXT: )
;; ALWAYS-NEXT: )
- ;; CAREFUL: (func $refinable (type $1) (param $0 (ref $A))
+ ;; CAREFUL: (func $refinable (type $2) (param $0 (ref $A))
;; CAREFUL-NEXT: (nop)
;; CAREFUL-NEXT: )
(func $refinable (param $ref (ref $A))
@@ -213,21 +213,19 @@
;; CAREFUL: (type $A (sub (struct)))
(type $A (sub (struct)))
;; ALWAYS: (type $B (sub $A (struct)))
- ;; CAREFUL: (type $1 (func (param (ref $A))))
-
;; CAREFUL: (type $B (sub $A (struct)))
(type $B (sub $A (struct)))
- ;; ALWAYS: (type $2 (func (param (ref $A))))
-
- ;; ALWAYS: (type $3 (func (param (ref $B))))
-
;; ALWAYS: (type $C (sub $B (struct)))
- ;; CAREFUL: (type $3 (func (param (ref $A) (ref $B))))
+ ;; CAREFUL: (type $2 (func (param (ref $A))))
;; CAREFUL: (type $C (sub $B (struct)))
(type $C (sub $B (struct)))
+ ;; ALWAYS: (type $3 (func (param (ref $A))))
+
+ ;; ALWAYS: (type $4 (func (param (ref $B))))
+
;; ALWAYS: (type $5 (func (param (ref $A) (ref $B))))
;; ALWAYS: (type $6 (func (param (ref $C) (ref $B))))
@@ -242,9 +240,11 @@
;; ALWAYS-NEXT: (local.get $B)
;; ALWAYS-NEXT: )
;; ALWAYS-NEXT: )
+ ;; CAREFUL: (type $4 (func (param (ref $A) (ref $B))))
+
;; CAREFUL: (type $5 (func (param (ref $C) (ref $B))))
- ;; CAREFUL: (func $calls1 (type $3) (param $A (ref $A)) (param $B (ref $B))
+ ;; CAREFUL: (func $calls1 (type $4) (param $A (ref $A)) (param $B (ref $B))
;; CAREFUL-NEXT: (call $refinable1
;; CAREFUL-NEXT: (local.get $A)
;; CAREFUL-NEXT: )
@@ -286,12 +286,12 @@
)
)
- ;; ALWAYS: (func $refinable1 (type $2) (param $ref (ref $A))
+ ;; ALWAYS: (func $refinable1 (type $3) (param $ref (ref $A))
;; ALWAYS-NEXT: (drop
;; ALWAYS-NEXT: (local.get $ref)
;; ALWAYS-NEXT: )
;; ALWAYS-NEXT: )
- ;; CAREFUL: (func $refinable1 (type $1) (param $0 (ref $A))
+ ;; CAREFUL: (func $refinable1 (type $2) (param $0 (ref $A))
;; CAREFUL-NEXT: (nop)
;; CAREFUL-NEXT: )
(func $refinable1 (param $ref (ref $A))
@@ -300,12 +300,12 @@
)
)
- ;; ALWAYS: (func $refinable2 (type $2) (param $ref (ref $A))
+ ;; ALWAYS: (func $refinable2 (type $3) (param $ref (ref $A))
;; ALWAYS-NEXT: (drop
;; ALWAYS-NEXT: (local.get $ref)
;; ALWAYS-NEXT: )
;; ALWAYS-NEXT: )
- ;; CAREFUL: (func $refinable2 (type $1) (param $0 (ref $A))
+ ;; CAREFUL: (func $refinable2 (type $2) (param $0 (ref $A))
;; CAREFUL-NEXT: (nop)
;; CAREFUL-NEXT: )
(func $refinable2 (param $ref (ref $A))
@@ -315,7 +315,7 @@
)
)
-;; ALWAYS: (func $refinable1_4 (type $3) (param $0 (ref $B))
+;; ALWAYS: (func $refinable1_4 (type $4) (param $0 (ref $B))
;; ALWAYS-NEXT: (local $ref (ref $A))
;; ALWAYS-NEXT: (local.set $ref
;; ALWAYS-NEXT: (local.get $0)
@@ -335,7 +335,7 @@
;; ALWAYS-NEXT: )
;; ALWAYS-NEXT: )
-;; ALWAYS: (func $refinable2_6 (type $3) (param $0 (ref $B))
+;; ALWAYS: (func $refinable2_6 (type $4) (param $0 (ref $B))
;; ALWAYS-NEXT: (local $ref (ref $A))
;; ALWAYS-NEXT: (local.set $ref
;; ALWAYS-NEXT: (local.get $0)
diff --git a/test/lit/passes/optimize-instructions-gc-iit.wast b/test/lit/passes/optimize-instructions-gc-iit.wast
index 4b9c46179..ab3005af5 100644
--- a/test/lit/passes/optimize-instructions-gc-iit.wast
+++ b/test/lit/passes/optimize-instructions-gc-iit.wast
@@ -18,10 +18,10 @@
;; TNH: (type $other (struct (field i64) (field f32)))
(type $other (struct (field i64) (field f32)))
- ;; CHECK: (func $foo (type $2)
+ ;; CHECK: (func $foo (type $3)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: )
- ;; TNH: (func $foo (type $2)
+ ;; TNH: (func $foo (type $3)
;; TNH-NEXT: (nop)
;; TNH-NEXT: )
(func $foo)
diff --git a/test/lit/passes/optimize-instructions-gc.wast b/test/lit/passes/optimize-instructions-gc.wast
index 60fca14fc..954cb1999 100644
--- a/test/lit/passes/optimize-instructions-gc.wast
+++ b/test/lit/passes/optimize-instructions-gc.wast
@@ -122,7 +122,7 @@
)
;; Similar, but for arrays.
- ;; CHECK: (func $store-trunc2 (type $15) (param $x (ref null $array))
+ ;; CHECK: (func $store-trunc2 (type $16) (param $x (ref null $array))
;; CHECK-NEXT: (array.set $array
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: (i32.const 0)
@@ -139,7 +139,7 @@
;; ref.is_null is not needed on a non-nullable value, and if something is
;; cast to its own type, we don't need that either, etc.
- ;; CHECK: (func $unneeded_test (type $16) (param $struct (ref $struct)) (param $func (ref func)) (param $i31 (ref i31))
+ ;; CHECK: (func $unneeded_test (type $17) (param $struct (ref $struct)) (param $func (ref func)) (param $i31 (ref i31))
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block (result i32)
;; CHECK-NEXT: (drop
@@ -182,7 +182,7 @@
;; similar to $unneeded_is, but the values are nullable. we can at least
;; leave just the null check.
- ;; CHECK: (func $unneeded_test_null (type $17) (param $struct (ref null $struct)) (param $func funcref) (param $i31 i31ref)
+ ;; CHECK: (func $unneeded_test_null (type $18) (param $struct (ref null $struct)) (param $func funcref) (param $i31 i31ref)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.is_null
;; CHECK-NEXT: (local.get $struct)
@@ -223,7 +223,7 @@
;; ref.as_non_null is not needed on a non-nullable value, and if something is
;; a func we don't need that either etc., and can just return the value.
- ;; CHECK: (func $unneeded_cast (type $16) (param $struct (ref $struct)) (param $func (ref func)) (param $i31 (ref i31))
+ ;; CHECK: (func $unneeded_cast (type $17) (param $struct (ref $struct)) (param $func (ref func)) (param $i31 (ref i31))
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (local.get $struct)
;; CHECK-NEXT: )
@@ -251,7 +251,7 @@
;; similar to $unneeded_cast, but the values are nullable. we can turn the
;; more specific things into ref.as_non_null.
- ;; CHECK: (func $unneeded_cast_null (type $17) (param $struct (ref null $struct)) (param $func funcref) (param $i31 i31ref)
+ ;; CHECK: (func $unneeded_cast_null (type $18) (param $struct (ref null $struct)) (param $func funcref) (param $i31 i31ref)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.as_non_null
;; CHECK-NEXT: (local.get $struct)
@@ -586,7 +586,7 @@
)
)
- ;; CHECK: (func $flip-cast-of-as-non-null (type $18) (param $x anyref)
+ ;; CHECK: (func $flip-cast-of-as-non-null (type $19) (param $x anyref)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.cast (ref $struct)
;; CHECK-NEXT: (local.get $x)
@@ -639,7 +639,7 @@
)
)
)
- ;; CHECK: (func $flip-tee-of-as-non-null (type $18) (param $x anyref)
+ ;; CHECK: (func $flip-tee-of-as-non-null (type $19) (param $x anyref)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.as_non_null
;; CHECK-NEXT: (local.tee $x
@@ -708,7 +708,7 @@
)
)
)
- ;; CHECK: (func $select-identical-arms-but-side-effect (type $19) (param $x (ref null $struct)) (param $y (ref null $struct)) (param $z i32)
+ ;; CHECK: (func $select-identical-arms-but-side-effect (type $20) (param $x (ref null $struct)) (param $y (ref null $struct)) (param $z i32)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (select
;; CHECK-NEXT: (struct.get_u $struct $i8
@@ -760,7 +760,7 @@
)
)
)
- ;; CHECK: (func $if-identical-arms-with-side-effect (type $19) (param $x (ref null $struct)) (param $y (ref null $struct)) (param $z i32)
+ ;; CHECK: (func $if-identical-arms-with-side-effect (type $20) (param $x (ref null $struct)) (param $y (ref null $struct)) (param $z i32)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (struct.get_u $struct $i8
;; CHECK-NEXT: (if (result (ref null $struct))
@@ -3129,7 +3129,7 @@
(unreachable)
)
- ;; CHECK: (func $array-copy-non-null (type $15) (param $x (ref null $array))
+ ;; CHECK: (func $array-copy-non-null (type $16) (param $x (ref null $array))
;; CHECK-NEXT: (block $block
;; CHECK-NEXT: (array.copy $array $array
;; CHECK-NEXT: (ref.as_non_null
diff --git a/test/lit/passes/simplify-locals-gc.wast b/test/lit/passes/simplify-locals-gc.wast
index b5b843474..2eb784664 100644
--- a/test/lit/passes/simplify-locals-gc.wast
+++ b/test/lit/passes/simplify-locals-gc.wast
@@ -4,13 +4,13 @@
;; RUN: | filecheck %s
(module
+ ;; CHECK: (type $struct (struct (field (mut i32))))
+ (type $struct (struct (field (mut i32))))
+
;; CHECK: (type $A (sub (struct (field structref))))
;; CHECK: (type $B (sub $A (struct (field (ref struct)))))
- ;; CHECK: (type $struct (struct (field (mut i32))))
- (type $struct (struct (field (mut i32))))
-
;; CHECK: (type $struct-immutable (struct (field i32)))
(type $struct-immutable (struct (field i32)))
@@ -21,7 +21,7 @@
(type $B (sub $A (struct (field (ref struct)))))
;; Writes to heap objects cannot be reordered with reads.
- ;; CHECK: (func $no-reorder-past-write (type $4) (param $x (ref $struct)) (result i32)
+ ;; CHECK: (func $no-reorder-past-write (type $5) (param $x (ref $struct)) (result i32)
;; CHECK-NEXT: (local $temp i32)
;; CHECK-NEXT: (local.set $temp
;; CHECK-NEXT: (struct.get $struct 0
@@ -289,7 +289,7 @@
)
)
- ;; CHECK: (func $call-vs-mutable-read (type $4) (param $0 (ref $struct)) (result i32)
+ ;; CHECK: (func $call-vs-mutable-read (type $5) (param $0 (ref $struct)) (result i32)
;; CHECK-NEXT: (local $temp i32)
;; CHECK-NEXT: (local.set $temp
;; CHECK-NEXT: (call $side-effect)
diff --git a/test/lit/passes/string-gathering.wast b/test/lit/passes/string-gathering.wast
index 877a1771b..524c6a1f0 100644
--- a/test/lit/passes/string-gathering.wast
+++ b/test/lit/passes/string-gathering.wast
@@ -25,19 +25,19 @@
(global $global (ref string) (string.const "foo"))
;; CHECK: (global $global2 stringref (global.get $string.const_bar))
- ;; LOWER: (type $0 (func))
+ ;; LOWER: (type $0 (array (mut i16)))
- ;; LOWER: (type $1 (func (param externref externref) (result i32)))
+ ;; LOWER: (type $1 (func))
- ;; LOWER: (type $2 (array (mut i16)))
+ ;; LOWER: (type $2 (func (param externref externref) (result i32)))
- ;; LOWER: (type $3 (func (param (ref null $2) i32 i32) (result (ref extern))))
+ ;; LOWER: (type $3 (func (param (ref null $0) i32 i32) (result (ref extern))))
;; LOWER: (type $4 (func (param i32) (result (ref extern))))
;; LOWER: (type $5 (func (param externref externref) (result (ref extern))))
- ;; LOWER: (type $6 (func (param externref (ref null $2) i32) (result i32)))
+ ;; LOWER: (type $6 (func (param externref (ref null $0) i32) (result i32)))
;; LOWER: (type $7 (func (param externref) (result i32)))
@@ -51,17 +51,17 @@
;; LOWER: (import "string.const" "2" (global $global (ref extern)))
- ;; LOWER: (import "wasm:js-string" "fromCharCodeArray" (func $fromCharCodeArray (type $3) (param (ref null $2) i32 i32) (result (ref extern))))
+ ;; LOWER: (import "wasm:js-string" "fromCharCodeArray" (func $fromCharCodeArray (type $3) (param (ref null $0) i32 i32) (result (ref extern))))
;; LOWER: (import "wasm:js-string" "fromCodePoint" (func $fromCodePoint (type $4) (param i32) (result (ref extern))))
;; LOWER: (import "wasm:js-string" "concat" (func $concat (type $5) (param externref externref) (result (ref extern))))
- ;; LOWER: (import "wasm:js-string" "intoCharCodeArray" (func $intoCharCodeArray (type $6) (param externref (ref null $2) i32) (result i32)))
+ ;; LOWER: (import "wasm:js-string" "intoCharCodeArray" (func $intoCharCodeArray (type $6) (param externref (ref null $0) i32) (result i32)))
- ;; LOWER: (import "wasm:js-string" "equals" (func $equals (type $1) (param externref externref) (result i32)))
+ ;; LOWER: (import "wasm:js-string" "equals" (func $equals (type $2) (param externref externref) (result i32)))
- ;; LOWER: (import "wasm:js-string" "compare" (func $compare (type $1) (param externref externref) (result i32)))
+ ;; LOWER: (import "wasm:js-string" "compare" (func $compare (type $2) (param externref externref) (result i32)))
;; LOWER: (import "wasm:js-string" "length" (func $length (type $7) (param externref) (result i32)))
@@ -80,7 +80,7 @@
;; CHECK-NEXT: (global.get $global)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; LOWER: (func $a (type $0)
+ ;; LOWER: (func $a (type $1)
;; LOWER-NEXT: (drop
;; LOWER-NEXT: (global.get $string.const_bar)
;; LOWER-NEXT: )
@@ -111,7 +111,7 @@
;; CHECK-NEXT: (global.get $global2)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; LOWER: (func $b (type $0)
+ ;; LOWER: (func $b (type $1)
;; LOWER-NEXT: (drop
;; LOWER-NEXT: (global.get $string.const_bar)
;; LOWER-NEXT: )
@@ -147,17 +147,17 @@
;; Multiple possible reusable globals. Also test ignoring of imports.
(module
;; CHECK: (import "a" "b" (global $import (ref string)))
- ;; LOWER: (type $0 (func (param externref externref) (result i32)))
+ ;; LOWER: (type $0 (array (mut i16)))
- ;; LOWER: (type $1 (array (mut i16)))
+ ;; LOWER: (type $1 (func (param externref externref) (result i32)))
- ;; LOWER: (type $2 (func (param (ref null $1) i32 i32) (result (ref extern))))
+ ;; LOWER: (type $2 (func (param (ref null $0) i32 i32) (result (ref extern))))
;; LOWER: (type $3 (func (param i32) (result (ref extern))))
;; LOWER: (type $4 (func (param externref externref) (result (ref extern))))
- ;; LOWER: (type $5 (func (param externref (ref null $1) i32) (result i32)))
+ ;; LOWER: (type $5 (func (param externref (ref null $0) i32) (result i32)))
;; LOWER: (type $6 (func (param externref) (result i32)))
@@ -176,17 +176,17 @@
;; LOWER: (import "string.const" "1" (global $global4 (ref extern)))
- ;; LOWER: (import "wasm:js-string" "fromCharCodeArray" (func $fromCharCodeArray (type $2) (param (ref null $1) i32 i32) (result (ref extern))))
+ ;; LOWER: (import "wasm:js-string" "fromCharCodeArray" (func $fromCharCodeArray (type $2) (param (ref null $0) i32 i32) (result (ref extern))))
;; LOWER: (import "wasm:js-string" "fromCodePoint" (func $fromCodePoint (type $3) (param i32) (result (ref extern))))
;; LOWER: (import "wasm:js-string" "concat" (func $concat (type $4) (param externref externref) (result (ref extern))))
- ;; LOWER: (import "wasm:js-string" "intoCharCodeArray" (func $intoCharCodeArray (type $5) (param externref (ref null $1) i32) (result i32)))
+ ;; LOWER: (import "wasm:js-string" "intoCharCodeArray" (func $intoCharCodeArray (type $5) (param externref (ref null $0) i32) (result i32)))
- ;; LOWER: (import "wasm:js-string" "equals" (func $equals (type $0) (param externref externref) (result i32)))
+ ;; LOWER: (import "wasm:js-string" "equals" (func $equals (type $1) (param externref externref) (result i32)))
- ;; LOWER: (import "wasm:js-string" "compare" (func $compare (type $0) (param externref externref) (result i32)))
+ ;; LOWER: (import "wasm:js-string" "compare" (func $compare (type $1) (param externref externref) (result i32)))
;; LOWER: (import "wasm:js-string" "length" (func $length (type $6) (param externref) (result i32)))
@@ -220,19 +220,19 @@
;; CHECK: (global $string.const_foo (ref string) (string.const "foo"))
;; CHECK: (global $global (mut (ref string)) (global.get $string.const_foo))
- ;; LOWER: (type $0 (func (param externref externref) (result i32)))
+ ;; LOWER: (type $0 (array (mut i16)))
- ;; LOWER: (type $1 (array (mut i16)))
+ ;; LOWER: (type $1 (func (param externref externref) (result i32)))
;; LOWER: (type $2 (func))
- ;; LOWER: (type $3 (func (param (ref null $1) i32 i32) (result (ref extern))))
+ ;; LOWER: (type $3 (func (param (ref null $0) i32 i32) (result (ref extern))))
;; LOWER: (type $4 (func (param i32) (result (ref extern))))
;; LOWER: (type $5 (func (param externref externref) (result (ref extern))))
- ;; LOWER: (type $6 (func (param externref (ref null $1) i32) (result i32)))
+ ;; LOWER: (type $6 (func (param externref (ref null $0) i32) (result i32)))
;; LOWER: (type $7 (func (param externref) (result i32)))
@@ -242,17 +242,17 @@
;; LOWER: (import "string.const" "0" (global $string.const_foo (ref extern)))
- ;; LOWER: (import "wasm:js-string" "fromCharCodeArray" (func $fromCharCodeArray (type $3) (param (ref null $1) i32 i32) (result (ref extern))))
+ ;; LOWER: (import "wasm:js-string" "fromCharCodeArray" (func $fromCharCodeArray (type $3) (param (ref null $0) i32 i32) (result (ref extern))))
;; LOWER: (import "wasm:js-string" "fromCodePoint" (func $fromCodePoint (type $4) (param i32) (result (ref extern))))
;; LOWER: (import "wasm:js-string" "concat" (func $concat (type $5) (param externref externref) (result (ref extern))))
- ;; LOWER: (import "wasm:js-string" "intoCharCodeArray" (func $intoCharCodeArray (type $6) (param externref (ref null $1) i32) (result i32)))
+ ;; LOWER: (import "wasm:js-string" "intoCharCodeArray" (func $intoCharCodeArray (type $6) (param externref (ref null $0) i32) (result i32)))
- ;; LOWER: (import "wasm:js-string" "equals" (func $equals (type $0) (param externref externref) (result i32)))
+ ;; LOWER: (import "wasm:js-string" "equals" (func $equals (type $1) (param externref externref) (result i32)))
- ;; LOWER: (import "wasm:js-string" "compare" (func $compare (type $0) (param externref externref) (result i32)))
+ ;; LOWER: (import "wasm:js-string" "compare" (func $compare (type $1) (param externref externref) (result i32)))
;; LOWER: (import "wasm:js-string" "length" (func $length (type $7) (param externref) (result i32)))
diff --git a/test/lit/passes/string-lowering_types.wast b/test/lit/passes/string-lowering_types.wast
index 54367e85a..cab84a1b8 100644
--- a/test/lit/passes/string-lowering_types.wast
+++ b/test/lit/passes/string-lowering_types.wast
@@ -8,9 +8,9 @@
;; types must remain separate.
(module
(rec
- ;; CHECK: (type $0 (func (param externref externref) (result i32)))
+ ;; CHECK: (type $0 (array (mut i16)))
- ;; CHECK: (type $1 (array (mut i16)))
+ ;; CHECK: (type $1 (func (param externref externref) (result i32)))
;; CHECK: (type $2 (func (param externref)))
@@ -23,13 +23,13 @@
)
(type $public (func (param stringref)))
- ;; CHECK: (type $6 (func (param (ref null $1) i32 i32) (result (ref extern))))
+ ;; CHECK: (type $6 (func (param (ref null $0) i32 i32) (result (ref extern))))
;; CHECK: (type $7 (func (param i32) (result (ref extern))))
;; CHECK: (type $8 (func (param externref externref) (result (ref extern))))
- ;; CHECK: (type $9 (func (param externref (ref null $1) i32) (result i32)))
+ ;; CHECK: (type $9 (func (param externref (ref null $0) i32) (result i32)))
;; CHECK: (type $10 (func (param externref) (result i32)))
@@ -43,17 +43,17 @@
;; CHECK: (import "a" "b" (func $import-implicit (type $3) (param (ref extern))))
(import "a" "b" (func $import-implicit (param (ref string))))
- ;; CHECK: (import "wasm:js-string" "fromCharCodeArray" (func $fromCharCodeArray (type $6) (param (ref null $1) i32 i32) (result (ref extern))))
+ ;; CHECK: (import "wasm:js-string" "fromCharCodeArray" (func $fromCharCodeArray (type $6) (param (ref null $0) i32 i32) (result (ref extern))))
;; CHECK: (import "wasm:js-string" "fromCodePoint" (func $fromCodePoint (type $7) (param i32) (result (ref extern))))
;; CHECK: (import "wasm:js-string" "concat" (func $concat (type $8) (param externref externref) (result (ref extern))))
- ;; CHECK: (import "wasm:js-string" "intoCharCodeArray" (func $intoCharCodeArray (type $9) (param externref (ref null $1) i32) (result i32)))
+ ;; CHECK: (import "wasm:js-string" "intoCharCodeArray" (func $intoCharCodeArray (type $9) (param externref (ref null $0) i32) (result i32)))
- ;; CHECK: (import "wasm:js-string" "equals" (func $equals (type $0) (param externref externref) (result i32)))
+ ;; CHECK: (import "wasm:js-string" "equals" (func $equals (type $1) (param externref externref) (result i32)))
- ;; CHECK: (import "wasm:js-string" "compare" (func $compare (type $0) (param externref externref) (result i32)))
+ ;; CHECK: (import "wasm:js-string" "compare" (func $compare (type $1) (param externref externref) (result i32)))
;; CHECK: (import "wasm:js-string" "length" (func $length (type $10) (param externref) (result i32)))
diff --git a/test/lit/passes/type-generalizing.wast b/test/lit/passes/type-generalizing.wast
index e9c92ff86..00a809648 100644
--- a/test/lit/passes/type-generalizing.wast
+++ b/test/lit/passes/type-generalizing.wast
@@ -862,12 +862,12 @@
)
(module
+ ;; CHECK: (type $0 (func (result eqref)))
+
;; CHECK: (type $top (sub (func (param i31ref) (result anyref))))
(type $top (sub (func (param i31ref) (result anyref))))
;; CHECK: (type $mid (sub $top (func (param eqref) (result anyref))))
(type $mid (sub $top (func (param eqref) (result anyref))))
- ;; CHECK: (type $2 (func (result eqref)))
-
;; CHECK: (type $bot (sub $mid (func (param eqref) (result eqref))))
(type $bot (sub $mid (func (param eqref) (result eqref))))
@@ -893,7 +893,7 @@
)
)
- ;; CHECK: (func $call-ref-results-limited (type $2) (result eqref)
+ ;; CHECK: (func $call-ref-results-limited (type $0) (result eqref)
;; CHECK-NEXT: (local $f (ref null $bot))
;; CHECK-NEXT: (local $arg eqref)
;; CHECK-NEXT: (call_ref $bot
@@ -912,7 +912,7 @@
)
)
- ;; CHECK: (func $call-ref-impossible (type $2) (result eqref)
+ ;; CHECK: (func $call-ref-impossible (type $0) (result eqref)
;; CHECK-NEXT: (local $f nullfuncref)
;; CHECK-NEXT: (local $arg anyref)
;; CHECK-NEXT: (block ;; (replaces unreachable CallRef we can't emit)
@@ -963,12 +963,12 @@
(module
- ;; CHECK: (type $0 (func (result anyref)))
-
;; CHECK: (type $top (sub (struct (field (mut eqref)) (field eqref))))
(type $top (sub (struct (field (mut eqref)) (field eqref))))
;; CHECK: (type $mid (sub $top (struct (field (mut eqref)) (field eqref) (field (mut eqref)))))
(type $mid (sub $top (struct (field (mut eqref)) (field eqref) (field (mut eqref)))))
+ ;; CHECK: (type $2 (func (result anyref)))
+
;; CHECK: (type $3 (func))
;; CHECK: (type $bot (sub $mid (struct (field (mut eqref)) (field i31ref) (field (mut eqref)))))
@@ -979,7 +979,7 @@
;; CHECK: (type $6 (func (result i31ref)))
- ;; CHECK: (func $struct-new (type $0) (result anyref)
+ ;; CHECK: (func $struct-new (type $2) (result anyref)
;; CHECK-NEXT: (local $var1 eqref)
;; CHECK-NEXT: (local $var2 anyref)
;; CHECK-NEXT: (struct.new $struct
@@ -997,7 +997,7 @@
)
)
- ;; CHECK: (func $struct-get (type $0) (result anyref)
+ ;; CHECK: (func $struct-get (type $2) (result anyref)
;; CHECK-NEXT: (local $var (ref null $top))
;; CHECK-NEXT: (struct.get $top 1
;; CHECK-NEXT: (local.get $var)
@@ -1027,7 +1027,7 @@
)
)
- ;; CHECK: (func $struct-get-index (type $0) (result anyref)
+ ;; CHECK: (func $struct-get-index (type $2) (result anyref)
;; CHECK-NEXT: (local $var (ref null $mid))
;; CHECK-NEXT: (struct.get $mid 2
;; CHECK-NEXT: (local.get $var)
@@ -1042,7 +1042,7 @@
)
)
- ;; CHECK: (func $struct-get-impossible (type $0) (result anyref)
+ ;; CHECK: (func $struct-get-impossible (type $2) (result anyref)
;; CHECK-NEXT: (local $var nullref)
;; CHECK-NEXT: (block ;; (replaces unreachable StructGet we can't emit)
;; CHECK-NEXT: (drop
diff --git a/test/lit/passes/type-refining.wast b/test/lit/passes/type-refining.wast
index 002b1c078..ab82aeb36 100644
--- a/test/lit/passes/type-refining.wast
+++ b/test/lit/passes/type-refining.wast
@@ -545,8 +545,6 @@
;; CHECK: (type $X (sub (struct)))
(type $X (sub (struct)))
- ;; CHECK: (type $1 (func))
-
;; CHECK: (type $A (sub (struct (field (ref $X)))))
;; CHECK: (type $Y (sub $X (struct)))
@@ -554,10 +552,12 @@
(type $A (sub (struct (field (ref $X)))))
+ ;; CHECK: (type $3 (func))
+
;; CHECK: (type $B (sub $A (struct (field (ref $Y)))))
(type $B (sub $A (struct (field (ref $Y)))))
- ;; CHECK: (func $foo (type $1)
+ ;; CHECK: (func $foo (type $3)
;; CHECK-NEXT: (local $unused2 (ref null $B))
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (struct.new $A
diff --git a/test/lit/passes/type-ssa-shared.wast b/test/lit/passes/type-ssa-shared.wast
index e3e1db2f2..d4049d1fa 100644
--- a/test/lit/passes/type-ssa-shared.wast
+++ b/test/lit/passes/type-ssa-shared.wast
@@ -76,10 +76,10 @@
;; doing so we should apply shareability properly and not error. (Specifically,
;; when we create a new subtype of $A, it must differ from $B.)
(module
- ;; CHECK: (type $0 (func))
-
;; CHECK: (type $A (sub (shared (array (mut i32)))))
(type $A (sub (shared (array (mut i32)))))
+ ;; CHECK: (type $1 (func))
+
;; CHECK: (type $B (sub $A (shared (array (mut i32)))))
(type $B (sub $A (shared (array (mut i32)))))
@@ -88,7 +88,7 @@
;; CHECK: (type $4 (struct (field (mut i32)) (field (mut i32)) (field (mut f64)) (field (mut f64)) (field (mut i32)) (field (mut f64)) (field (mut f64)) (field (mut i32)) (field (mut i32)) (field (mut i32)) (field (mut i32))))
- ;; CHECK: (func $func (type $0)
+ ;; CHECK: (func $func (type $1)
;; CHECK-NEXT: (local $local (ref $B))
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (array.new_default $A_1
diff --git a/test/lit/passes/type-ssa.wast b/test/lit/passes/type-ssa.wast
index 4cc5f6494..599c0504e 100644
--- a/test/lit/passes/type-ssa.wast
+++ b/test/lit/passes/type-ssa.wast
@@ -133,11 +133,11 @@
;; Some of these are uninteresting and should not get a new type.
(module
- ;; CHECK: (type $0 (func (param anyref arrayref)))
-
;; CHECK: (type $struct (sub (struct (field anyref))))
(type $struct (sub (struct (field (ref null any)))))
+ ;; CHECK: (type $1 (func (param anyref arrayref)))
+
;; CHECK: (rec
;; CHECK-NEXT: (type $struct_1 (sub $struct (struct (field anyref))))
@@ -145,7 +145,7 @@
;; CHECK: (type $struct_3 (sub $struct (struct (field anyref))))
- ;; CHECK: (func $foo (type $0) (param $any anyref) (param $array arrayref)
+ ;; CHECK: (func $foo (type $1) (param $any anyref) (param $array arrayref)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (struct.new_default $struct_1)
;; CHECK-NEXT: )
diff --git a/test/lit/passes/vacuum-gc.wast b/test/lit/passes/vacuum-gc.wast
index a59b2da1e..dd4934e0a 100644
--- a/test/lit/passes/vacuum-gc.wast
+++ b/test/lit/passes/vacuum-gc.wast
@@ -38,7 +38,7 @@
)
)
- ;; CHECK: (func $vacuum-nonnull (type $0)
+ ;; CHECK: (func $vacuum-nonnull (type $1)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: )
(func $vacuum-nonnull
@@ -101,7 +101,7 @@
)
)
- ;; CHECK: (func $dropped-calls (type $0)
+ ;; CHECK: (func $dropped-calls (type $1)
;; CHECK-NEXT: (block
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (call $helper-i32)
diff --git a/test/lit/passes/vacuum-tnh.wast b/test/lit/passes/vacuum-tnh.wast
index 8a93a720f..1bb4ba139 100644
--- a/test/lit/passes/vacuum-tnh.wast
+++ b/test/lit/passes/vacuum-tnh.wast
@@ -294,7 +294,7 @@
;; YESTNH-NEXT: )
;; YESTNH-NEXT: )
;; YESTNH-NEXT: )
- ;; NO_TNH: (func $if-unreachable (type $1) (param $p i32)
+ ;; NO_TNH: (func $if-unreachable (type $2) (param $p i32)
;; NO_TNH-NEXT: (if
;; NO_TNH-NEXT: (local.get $p)
;; NO_TNH-NEXT: (then
@@ -433,7 +433,7 @@
;; YESTNH-NEXT: )
;; YESTNH-NEXT: )
;; YESTNH-NEXT: )
- ;; NO_TNH: (func $block-unreachable (type $1) (param $p i32)
+ ;; NO_TNH: (func $block-unreachable (type $2) (param $p i32)
;; NO_TNH-NEXT: (if
;; NO_TNH-NEXT: (local.get $p)
;; NO_TNH-NEXT: (then
@@ -499,7 +499,7 @@
;; YESTNH-NEXT: )
;; YESTNH-NEXT: )
;; YESTNH-NEXT: )
- ;; NO_TNH: (func $block-unreachable-named (type $1) (param $p i32)
+ ;; NO_TNH: (func $block-unreachable-named (type $2) (param $p i32)
;; NO_TNH-NEXT: (if
;; NO_TNH-NEXT: (local.get $p)
;; NO_TNH-NEXT: (then
@@ -547,7 +547,7 @@
;; YESTNH: (func $block-unreachable-all (type $1) (param $p i32)
;; YESTNH-NEXT: (nop)
;; YESTNH-NEXT: )
- ;; NO_TNH: (func $block-unreachable-all (type $1) (param $p i32)
+ ;; NO_TNH: (func $block-unreachable-all (type $2) (param $p i32)
;; NO_TNH-NEXT: (if
;; NO_TNH-NEXT: (local.get $p)
;; NO_TNH-NEXT: (then
@@ -688,7 +688,7 @@
;; YESTNH-NEXT: (unreachable)
;; YESTNH-NEXT: )
;; YESTNH-NEXT: )
- ;; NO_TNH: (func $loop-unreachable (type $1) (param $p i32)
+ ;; NO_TNH: (func $loop-unreachable (type $2) (param $p i32)
;; NO_TNH-NEXT: (loop $loop
;; NO_TNH-NEXT: (i32.store
;; NO_TNH-NEXT: (i32.const 0)