summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/passes/Print.cpp44
-rw-r--r--test/example/c-api-kitchen-sink.txt2
-rw-r--r--test/heap-types.wast.from-wast4
-rw-r--r--test/heap-types.wast.fromBinary4
-rw-r--r--test/heap-types.wast.fromBinary.noDebugInfo4
-rw-r--r--test/lit/isorecursive-good.wast6
-rw-r--r--test/lit/isorecursive-output-ordering.wast4
-rw-r--r--test/lit/parse-nominal-types-extends.wast10
-rw-r--r--test/lit/parse-nominal-types.wast10
-rw-r--r--test/lit/passes/abstract-type-refining.wast54
-rw-r--r--test/lit/passes/cfp.wast36
-rw-r--r--test/lit/passes/coalesce-locals-gc.wast2
-rw-r--r--test/lit/passes/dae-gc-refine-params.wast8
-rw-r--r--test/lit/passes/dae-gc-refine-return.wast6
-rw-r--r--test/lit/passes/gsi.wast26
-rw-r--r--test/lit/passes/gto-mutability.wast6
-rw-r--r--test/lit/passes/gto-removals.wast12
-rw-r--r--test/lit/passes/gufa-refs.wast52
-rw-r--r--test/lit/passes/gufa-vs-cfp.wast34
-rw-r--r--test/lit/passes/monomorphize.wast24
-rw-r--r--test/lit/passes/optimize-casts.wast2
-rw-r--r--test/lit/passes/optimize-instructions-gc-iit.wast16
-rw-r--r--test/lit/passes/optimize-instructions-gc.wast8
-rw-r--r--test/lit/passes/remove-unused-module-elements-refs.wast16
-rw-r--r--test/lit/passes/roundtrip-gc-types.wast2
-rw-r--r--test/lit/passes/rse-gc.wast2
-rw-r--r--test/lit/passes/signature-pruning.wast6
-rw-r--r--test/lit/passes/signature-refining.wast10
-rw-r--r--test/lit/passes/simplify-locals-gc.wast2
-rw-r--r--test/lit/passes/type-merging-tnh.wast4
-rw-r--r--test/lit/passes/type-merging.wast48
-rw-r--r--test/lit/passes/type-refining-isorecursive.wast4
-rw-r--r--test/lit/passes/type-refining.wast52
-rw-r--r--test/lit/passes/type-ssa.wast34
-rw-r--r--test/lit/recursive-types.wast2
-rw-r--r--test/lit/subtype-chain.wast8
-rw-r--r--test/lit/subtypes.wast6
-rw-r--r--test/lit/tail-call.wast2
-rw-r--r--test/lit/wat-kitchen-sink.wast4
-rw-r--r--test/passes/Oz_fuzz-exec_all-features.txt2
-rw-r--r--test/subtypes.wast.from-wast8
-rw-r--r--test/subtypes.wast.fromBinary8
-rw-r--r--test/subtypes.wast.fromBinary.noDebugInfo8
43 files changed, 293 insertions, 309 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index ab5ef514f..5d49ad900 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -2943,12 +2943,7 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> {
void handleSignature(HeapType curr, Name name = Name()) {
Signature sig = curr.getSignature();
- bool hasSupertype = !name.is() && !!curr.getSuperType();
- if (hasSupertype) {
- o << "(func_subtype";
- } else {
- o << "(func";
- }
+ o << "(func";
if (name.is()) {
o << " $" << name;
if (currModule && currModule->features.hasGC()) {
@@ -2978,10 +2973,6 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> {
}
o << ')';
}
- if (hasSupertype) {
- o << ' ';
- printSupertypeOr(curr, "func");
- }
o << ")";
}
void handleFieldBody(const Field& field) {
@@ -3004,27 +2995,13 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> {
}
}
void handleArray(HeapType curr) {
- bool hasSupertype = !!curr.getSuperType();
- if (hasSupertype) {
- o << "(array_subtype ";
- } else {
- o << "(array ";
- }
+ o << "(array ";
handleFieldBody(curr.getArray().element);
- if (hasSupertype) {
- o << ' ';
- printSupertypeOr(curr, "data");
- }
o << ')';
}
void handleStruct(HeapType curr) {
- bool hasSupertype = !!curr.getSuperType();
const auto& fields = curr.getStruct().fields;
- if (hasSupertype) {
- o << "(struct_subtype ";
- } else {
- o << "(struct ";
- }
+ o << "(struct ";
auto sep = "";
for (Index i = 0; i < fields.size(); i++) {
o << sep << "(field ";
@@ -3037,13 +3014,17 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> {
o << ')';
sep = " ";
}
- if (hasSupertype) {
- o << ' ';
- printSupertypeOr(curr, "data");
- }
o << ')';
}
void handleHeapType(HeapType type) {
+ bool hasSuper = false;
+ // TODO: Consider finality once we support that.
+ if (auto super = type.getSuperType()) {
+ hasSuper = true;
+ o << "(sub ";
+ TypeNamePrinter(o, currModule).print(*super);
+ o << ' ';
+ }
if (type.isSignature()) {
handleSignature(type);
} else if (type.isArray()) {
@@ -3053,6 +3034,9 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> {
} else {
o << type;
}
+ if (hasSuper) {
+ o << ')';
+ }
}
void visitExport(Export* curr) {
o << '(';
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index 982fbda50..75a4d1d8d 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -3170,7 +3170,7 @@ module with recursive GC types:
(type $SomeStruct (struct (field $SomeField (mut (ref null $SomeStruct)))))
(type $SomeSignature (func (param (ref null $SomeSignature) (ref null $SomeArray)) (result (ref null $SomeSignature))))
(type $none_=>_none (func))
- (type $SomeSubStruct (struct_subtype (field $SomeField (mut (ref null $SomeStruct))) (field $SomePackedField i8) $SomeStruct))
+ (type $SomeSubStruct (sub $SomeStruct (struct (field $SomeField (mut (ref null $SomeStruct))) (field $SomePackedField i8))))
(func $test (type $none_=>_none)
(local $0 (ref null $SomeArray))
(local $1 (ref null $SomeStruct))
diff --git a/test/heap-types.wast.from-wast b/test/heap-types.wast.from-wast
index cab83fd5e..d91655f36 100644
--- a/test/heap-types.wast.from-wast
+++ b/test/heap-types.wast.from-wast
@@ -7,8 +7,8 @@
(type $matrix (array (mut (ref null $vector))))
(type $bytes (array (mut i8)))
(type $parent (struct ))
- (type $child (struct_subtype (field i32) $parent))
- (type $grandchild (struct_subtype (field i32) (field i64) $child))
+ (type $child (sub $parent (struct (field i32))))
+ (type $grandchild (sub $child (struct (field i32) (field i64))))
(type $ref?|$vector|_=>_none (func (param (ref null $vector))))
(type $nested-child-struct (struct (field (mut (ref $child)))))
(type $words (array (mut i32)))
diff --git a/test/heap-types.wast.fromBinary b/test/heap-types.wast.fromBinary
index 7c304a906..849c2b32b 100644
--- a/test/heap-types.wast.fromBinary
+++ b/test/heap-types.wast.fromBinary
@@ -7,8 +7,8 @@
(type $bytes (array (mut i8)))
(type $struct.C (struct (field $named-mut (mut f32))))
(type $parent (struct ))
- (type $child (struct_subtype (field i32) $parent))
- (type $grandchild (struct_subtype (field i32) (field i64) $child))
+ (type $child (sub $parent (struct (field i32))))
+ (type $grandchild (sub $child (struct (field i32) (field i64))))
(type $ref?|$vector|_=>_none (func (param (ref null $vector))))
(type $nested-child-struct (struct (field (mut (ref $child)))))
(type $words (array (mut i32)))
diff --git a/test/heap-types.wast.fromBinary.noDebugInfo b/test/heap-types.wast.fromBinary.noDebugInfo
index 097e92a3d..78bee266c 100644
--- a/test/heap-types.wast.fromBinary.noDebugInfo
+++ b/test/heap-types.wast.fromBinary.noDebugInfo
@@ -7,8 +7,8 @@
(type $[mut:i8] (array (mut i8)))
(type ${mut:f32} (struct (field (mut f32))))
(type ${} (struct ))
- (type ${i32} (struct_subtype (field i32) ${}))
- (type ${i32_i64} (struct_subtype (field i32) (field i64) ${i32}))
+ (type ${i32} (sub ${} (struct (field i32))))
+ (type ${i32_i64} (sub ${i32} (struct (field i32) (field i64))))
(type $ref?|[mut:f64]|_=>_none (func (param (ref null $[mut:f64]))))
(type ${mut:ref|{i32}|} (struct (field (mut (ref ${i32})))))
(type $[mut:i32] (array (mut i32)))
diff --git a/test/lit/isorecursive-good.wast b/test/lit/isorecursive-good.wast
index 04880101f..ba4244368 100644
--- a/test/lit/isorecursive-good.wast
+++ b/test/lit/isorecursive-good.wast
@@ -9,7 +9,7 @@
;; HYBRID-NEXT: (type $super-struct (struct (field i32)))
(type $super-struct (struct i32))
;; NOMINAL: (type $sub-struct (struct_subtype (field i32) (field i64) $super-struct))
- ;; HYBRID: (type $sub-struct (struct_subtype (field i32) (field i64) $super-struct))
+ ;; HYBRID: (type $sub-struct (sub $super-struct (struct (field i32) (field i64))))
(type $sub-struct (sub $super-struct (struct i32 i64)))
)
@@ -17,7 +17,7 @@
;; HYBRID: (rec
;; HYBRID-NEXT: (type $super-array (array (ref $super-struct)))
(type $super-array (array (ref $super-struct)))
- ;; HYBRID: (type $sub-array (array_subtype (ref $sub-struct) $super-array))
+ ;; HYBRID: (type $sub-array (sub $super-array (array (ref $sub-struct))))
(type $sub-array (sub $super-array (array (ref $sub-struct))))
)
@@ -26,7 +26,7 @@
;; HYBRID-NEXT: (type $super-func (func (param (ref $sub-array)) (result (ref $super-array))))
(type $super-func (func (param (ref $sub-array)) (result (ref $super-array))))
;; NOMINAL: (type $sub-func (func_subtype (param (ref $super-array)) (result (ref $sub-array)) $super-func))
- ;; HYBRID: (type $sub-func (func_subtype (param (ref $super-array)) (result (ref $sub-array)) $super-func))
+ ;; HYBRID: (type $sub-func (sub $super-func (func (param (ref $super-array)) (result (ref $sub-array)))))
(type $sub-func (sub $super-func (func (param (ref $super-array)) (result (ref $sub-array)))))
)
diff --git a/test/lit/isorecursive-output-ordering.wast b/test/lit/isorecursive-output-ordering.wast
index ca906c76b..3dc76a10a 100644
--- a/test/lit/isorecursive-output-ordering.wast
+++ b/test/lit/isorecursive-output-ordering.wast
@@ -55,7 +55,7 @@
(rec
;; CHECK: (rec
- ;; CHECK-NEXT: (type $shrub (struct_subtype $leaf))
+ ;; CHECK-NEXT: (type $shrub (sub $leaf (struct )))
;; CHECK: (type $used-a-ton (struct ))
@@ -75,7 +75,7 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $root (struct ))
(type $root (struct_subtype data))
- ;; CHECK: (type $used-a-lot (struct_subtype $twig))
+ ;; CHECK: (type $used-a-lot (sub $twig (struct )))
(type $used-a-lot (struct_subtype $twig))
)
diff --git a/test/lit/parse-nominal-types-extends.wast b/test/lit/parse-nominal-types-extends.wast
index ade4f5e6b..51341dfd0 100644
--- a/test/lit/parse-nominal-types-extends.wast
+++ b/test/lit/parse-nominal-types-extends.wast
@@ -10,7 +10,7 @@
;; CHECK: (type $super (func))
(type $super (func))
- ;; CHECK: (type $sub (func_subtype $super))
+ ;; CHECK: (type $sub (sub $super (func)))
(type $sub (func) (extends $super))
;; CHECK: (global $g (ref null $sub) (ref.null nofunc))
@@ -22,7 +22,7 @@
;; CHECK: (type $super (func (param i32) (result i32)))
(type $super (func (param i32) (result i32)))
- ;; CHECK: (type $sub (func_subtype (param i32) (result i32) $super))
+ ;; CHECK: (type $sub (sub $super (func (param i32) (result i32))))
(type $sub (func (param i32) (result i32)) (extends $super))
;; CHECK: (global $g (ref null $sub) (ref.null nofunc))
@@ -34,7 +34,7 @@
;; CHECK: (type $super (struct ))
(type $super (struct))
- ;; CHECK: (type $sub (struct_subtype $super))
+ ;; CHECK: (type $sub (sub $super (struct )))
(type $sub (struct) (extends $super))
;; CHECK: (global $g (ref null $sub) (ref.null none))
@@ -46,7 +46,7 @@
;; CHECK: (type $super (struct (field i32) (field i64)))
(type $super (struct (field i32) i64))
- ;; CHECK: (type $sub (struct_subtype (field i32) (field i64) $super))
+ ;; CHECK: (type $sub (sub $super (struct (field i32) (field i64))))
(type $sub (struct i32 (field i64)) (extends $super))
;; CHECK: (global $g (ref null $sub) (ref.null none))
@@ -58,7 +58,7 @@
;; CHECK: (type $super (array i8))
(type $super (array i8))
- ;; CHECK: (type $sub (array_subtype i8 $super))
+ ;; CHECK: (type $sub (sub $super (array i8)))
(type $sub (array i8) (extends $super))
;; CHECK: (global $g (ref null $sub) (ref.null none))
diff --git a/test/lit/parse-nominal-types.wast b/test/lit/parse-nominal-types.wast
index 46b27bc58..f43c12950 100644
--- a/test/lit/parse-nominal-types.wast
+++ b/test/lit/parse-nominal-types.wast
@@ -10,7 +10,7 @@
;; CHECK: (type $super (func))
(type $super (func_subtype func))
- ;; CHECK: (type $sub (func_subtype $super))
+ ;; CHECK: (type $sub (sub $super (func)))
(type $sub (func_subtype $super))
;; CHECK: (global $g (ref null $sub) (ref.null nofunc))
@@ -22,7 +22,7 @@
;; CHECK: (type $super (func (param i32) (result i32)))
(type $super (func_subtype (param i32) (result i32) func))
- ;; CHECK: (type $sub (func_subtype (param i32) (result i32) $super))
+ ;; CHECK: (type $sub (sub $super (func (param i32) (result i32))))
(type $sub (func_subtype (param i32) (result i32) $super))
;; CHECK: (global $g (ref null $sub) (ref.null nofunc))
@@ -34,7 +34,7 @@
;; CHECK: (type $super (struct ))
(type $super (struct_subtype data))
- ;; CHECK: (type $sub (struct_subtype $super))
+ ;; CHECK: (type $sub (sub $super (struct )))
(type $sub (struct_subtype $super))
;; CHECK: (global $g (ref null $sub) (ref.null none))
@@ -46,7 +46,7 @@
;; CHECK: (type $super (struct (field i32) (field i64)))
(type $super (struct_subtype (field i32) i64 data))
- ;; CHECK: (type $sub (struct_subtype (field i32) (field i64) $super))
+ ;; CHECK: (type $sub (sub $super (struct (field i32) (field i64))))
(type $sub (struct_subtype i32 (field i64) $super))
;; CHECK: (global $g (ref null $sub) (ref.null none))
@@ -58,7 +58,7 @@
;; CHECK: (type $super (array i8))
(type $super (array_subtype i8 data))
- ;; CHECK: (type $sub (array_subtype i8 $super))
+ ;; CHECK: (type $sub (sub $super (array i8)))
(type $sub (array_subtype i8 $super))
;; CHECK: (global $g (ref null $sub) (ref.null none))
diff --git a/test/lit/passes/abstract-type-refining.wast b/test/lit/passes/abstract-type-refining.wast
index 8310d28d1..99b19f172 100644
--- a/test/lit/passes/abstract-type-refining.wast
+++ b/test/lit/passes/abstract-type-refining.wast
@@ -21,18 +21,18 @@
;; YESTNH-NEXT: (type $none_=>_none (func))
;; YESTNH: (type $B (struct ))
- ;; NO_TNH: (type $B (struct_subtype $A))
+ ;; NO_TNH: (type $B (sub $A (struct )))
(type $B (struct_subtype $A))
- ;; YESTNH: (type $C (struct_subtype $B))
- ;; NO_TNH: (type $C (struct_subtype $B))
+ ;; YESTNH: (type $C (sub $B (struct )))
+ ;; NO_TNH: (type $C (sub $B (struct )))
(type $C (struct_subtype $B))
- ;; NO_TNH: (type $D (struct_subtype $C))
+ ;; NO_TNH: (type $D (sub $C (struct )))
(type $D (struct_subtype $C))
- ;; YESTNH: (type $E (struct_subtype $C))
- ;; NO_TNH: (type $E (struct_subtype $D))
+ ;; YESTNH: (type $E (sub $C (struct )))
+ ;; NO_TNH: (type $E (sub $D (struct )))
(type $E (struct_subtype $D))
;; YESTNH: (type $anyref_=>_none (func (param anyref)))
@@ -284,16 +284,16 @@
;; NO_TNH-NEXT: (type $A (struct ))
(type $A (struct))
- ;; YESTNH: (type $B1 (struct_subtype $A))
+ ;; YESTNH: (type $B1 (sub $A (struct )))
;; YESTNH: (type $anyref_=>_none (func (param anyref)))
- ;; YESTNH: (type $B (struct_subtype $A))
- ;; NO_TNH: (type $B1 (struct_subtype $A))
+ ;; YESTNH: (type $B (sub $A (struct )))
+ ;; NO_TNH: (type $B1 (sub $A (struct )))
;; NO_TNH: (type $anyref_=>_none (func (param anyref)))
- ;; NO_TNH: (type $B (struct_subtype $A))
+ ;; NO_TNH: (type $B (sub $A (struct )))
(type $B (struct_subtype $A))
(type $B1 (struct_subtype $A)) ;; this is a new type
@@ -384,7 +384,7 @@
;; YESTNH: (rec
;; YESTNH-NEXT: (type $B1 (struct ))
- ;; NO_TNH: (type $B1 (struct_subtype $A))
+ ;; NO_TNH: (type $B1 (sub $A (struct )))
(type $B1 (struct_subtype $A)) ;; this is a new type
)
@@ -467,12 +467,12 @@
;; NO_TNH-NEXT: (type $A (struct ))
(type $A (struct))
- ;; NO_TNH: (type $B (struct_subtype $A))
+ ;; NO_TNH: (type $B (sub $A (struct )))
(type $B (struct_subtype $A))
;; YESTNH: (rec
;; YESTNH-NEXT: (type $C (struct ))
- ;; NO_TNH: (type $C (struct_subtype $B))
+ ;; NO_TNH: (type $C (sub $B (struct )))
(type $C (struct_subtype $B))
;; YESTNH: (type $anyref_=>_none (func (param anyref)))
@@ -842,14 +842,14 @@
;; NO_TNH: (type $A (struct ))
(type $A (struct))
- ;; NO_TNH: (type $B (struct_subtype $A))
+ ;; NO_TNH: (type $B (sub $A (struct )))
(type $B (struct_subtype $A))
;; YESTNH: (rec
;; YESTNH-NEXT: (type $anyref_=>_none (func (param anyref)))
;; YESTNH: (type $C1 (struct ))
- ;; NO_TNH: (type $C1 (struct_subtype $B))
+ ;; NO_TNH: (type $C1 (sub $B (struct )))
(type $C1 (struct_subtype $B))
(type $C2 (struct_subtype $B))
@@ -1006,12 +1006,12 @@
;; NO_TNH-NEXT: (type $A (func))
(type $A (func))
- ;; YESTNH: (type $B (func_subtype $A))
- ;; NO_TNH: (type $B (func_subtype $A))
+ ;; YESTNH: (type $B (sub $A (func)))
+ ;; NO_TNH: (type $B (sub $A (func)))
(type $B (func_subtype $A))
- ;; YESTNH: (type $C (func_subtype $B))
- ;; NO_TNH: (type $C (func_subtype $B))
+ ;; YESTNH: (type $C (sub $B (func)))
+ ;; NO_TNH: (type $C (sub $B (func)))
(type $C (func_subtype $B))
;; YESTNH: (type $funcref_=>_none (func (param funcref)))
@@ -1101,15 +1101,15 @@
;; YESTNH: (rec
;; YESTNH-NEXT: (type $funcref_=>_none (func (param funcref)))
- ;; YESTNH: (type $B (func_subtype $A))
+ ;; YESTNH: (type $B (sub $A (func)))
;; NO_TNH: (rec
;; NO_TNH-NEXT: (type $funcref_=>_none (func (param funcref)))
- ;; NO_TNH: (type $B (func_subtype $A))
+ ;; NO_TNH: (type $B (sub $A (func)))
(type $B (func_subtype $A))
- ;; YESTNH: (type $C (func_subtype $B))
- ;; NO_TNH: (type $C (func_subtype $B))
+ ;; YESTNH: (type $C (sub $B (func)))
+ ;; NO_TNH: (type $C (sub $B (func)))
(type $C (func_subtype $B))
;; YESTNH: (elem declare func $A $C)
@@ -1220,12 +1220,12 @@
;; NO_TNH: (type $A (array (mut i32)))
(type $A (array (mut i32)))
- ;; YESTNH: (type $B (array_subtype (mut i32) $A))
- ;; NO_TNH: (type $B (array_subtype (mut i32) $A))
+ ;; YESTNH: (type $B (sub $A (array (mut i32))))
+ ;; NO_TNH: (type $B (sub $A (array (mut i32))))
(type $B (array_subtype (mut i32) $A))
- ;; YESTNH: (type $C (array_subtype (mut i32) $B))
- ;; NO_TNH: (type $C (array_subtype (mut i32) $B))
+ ;; YESTNH: (type $C (sub $B (array (mut i32))))
+ ;; NO_TNH: (type $C (sub $B (array (mut i32))))
(type $C (array_subtype (mut i32) $B))
;; YESTNH: (global $A (ref $A) (array.new $A
diff --git a/test/lit/passes/cfp.wast b/test/lit/passes/cfp.wast
index cc98227b5..e9eaf001f 100644
--- a/test/lit/passes/cfp.wast
+++ b/test/lit/passes/cfp.wast
@@ -551,7 +551,7 @@
;; CHECK: (type $struct (struct (field i32)))
(type $struct (struct i32))
- ;; CHECK: (type $substruct (struct_subtype (field i32) $struct))
+ ;; CHECK: (type $substruct (sub $struct (struct (field i32))))
(type $substruct (struct_subtype i32 $struct))
;; CHECK: (type $ref?|$substruct|_=>_none (func (param (ref null $substruct))))
@@ -598,7 +598,7 @@
(type $struct (struct (mut i32)))
;; CHECK: (type $ref?|$struct|_=>_none (func (param (ref null $struct))))
- ;; CHECK: (type $substruct (struct_subtype (field (mut i32)) $struct))
+ ;; CHECK: (type $substruct (sub $struct (struct (field (mut i32)))))
(type $substruct (struct_subtype (mut i32) $struct))
;; CHECK: (type $ref?|$substruct|_=>_none (func (param (ref null $substruct))))
@@ -655,7 +655,7 @@
;; CHECK: (type $struct (struct (field i32)))
(type $struct (struct i32))
- ;; CHECK: (type $substruct (struct_subtype (field i32) (field f64) $struct))
+ ;; CHECK: (type $substruct (sub $struct (struct (field i32) (field f64))))
(type $substruct (struct_subtype i32 f64 $struct))
;; CHECK: (type $ref?|$struct|_=>_none (func (param (ref null $struct))))
@@ -704,7 +704,7 @@
(type $struct (struct i32))
;; CHECK: (type $none_=>_none (func))
- ;; CHECK: (type $substruct (struct_subtype (field i32) (field f64) $struct))
+ ;; CHECK: (type $substruct (sub $struct (struct (field i32) (field f64))))
(type $substruct (struct_subtype i32 f64 $struct))
;; CHECK: (type $ref?|$struct|_=>_none (func (param (ref null $struct))))
@@ -764,7 +764,7 @@
(type $struct (struct i32))
;; CHECK: (type $none_=>_none (func))
- ;; CHECK: (type $substruct (struct_subtype (field i32) (field f64) $struct))
+ ;; CHECK: (type $substruct (sub $struct (struct (field i32) (field f64))))
(type $substruct (struct_subtype i32 f64 $struct))
;; CHECK: (type $ref?|$struct|_=>_none (func (param (ref null $struct))))
@@ -820,7 +820,7 @@
;; CHECK: (type $struct (struct (field i32)))
(type $struct (struct i32))
- ;; CHECK: (type $substruct (struct_subtype (field i32) (field f64) $struct))
+ ;; CHECK: (type $substruct (sub $struct (struct (field i32) (field f64))))
(type $substruct (struct_subtype i32 f64 $struct))
;; CHECK: (type $none_=>_none (func))
@@ -879,7 +879,7 @@
;; CHECK: (type $struct (struct (field (mut i32))))
(type $struct (struct (mut i32)))
- ;; CHECK: (type $substruct (struct_subtype (field (mut i32)) (field f64) $struct))
+ ;; CHECK: (type $substruct (sub $struct (struct (field (mut i32)) (field f64))))
(type $substruct (struct_subtype (mut i32) f64 $struct))
;; CHECK: (type $ref?|$struct|_=>_none (func (param (ref null $struct))))
@@ -942,10 +942,10 @@
;; CHECK: (type $struct1 (struct (field i32)))
(type $struct1 (struct i32))
- ;; CHECK: (type $struct2 (struct_subtype (field i32) (field f64) $struct1))
+ ;; CHECK: (type $struct2 (sub $struct1 (struct (field i32) (field f64))))
(type $struct2 (struct_subtype i32 f64 $struct1))
- ;; CHECK: (type $struct3 (struct_subtype (field i32) (field f64) (field anyref) $struct2))
+ ;; CHECK: (type $struct3 (sub $struct2 (struct (field i32) (field f64) (field anyref))))
(type $struct3 (struct_subtype i32 f64 anyref $struct2))
;; CHECK: (type $none_=>_none (func))
@@ -1077,10 +1077,10 @@
;; CHECK: (type $struct1 (struct (field i32) (field i32)))
(type $struct1 (struct i32 i32))
- ;; CHECK: (type $struct2 (struct_subtype (field i32) (field i32) (field f64) (field f64) $struct1))
+ ;; CHECK: (type $struct2 (sub $struct1 (struct (field i32) (field i32) (field f64) (field f64))))
(type $struct2 (struct_subtype i32 i32 f64 f64 $struct1))
- ;; CHECK: (type $struct3 (struct_subtype (field i32) (field i32) (field f64) (field f64) (field anyref) (field anyref) $struct2))
+ ;; CHECK: (type $struct3 (sub $struct2 (struct (field i32) (field i32) (field f64) (field f64) (field anyref) (field anyref))))
(type $struct3 (struct_subtype i32 i32 f64 f64 anyref anyref $struct2))
;; CHECK: (type $anyref_=>_none (func (param anyref)))
@@ -1306,9 +1306,9 @@
(module
;; CHECK: (type $struct1 (struct (field (mut i32))))
(type $struct1 (struct (mut i32)))
- ;; CHECK: (type $struct2 (struct_subtype (field (mut i32)) (field f64) $struct1))
+ ;; CHECK: (type $struct2 (sub $struct1 (struct (field (mut i32)) (field f64))))
(type $struct2 (struct_subtype (mut i32) f64 $struct1))
- ;; CHECK: (type $struct3 (struct_subtype (field (mut i32)) (field f64) (field anyref) $struct2))
+ ;; CHECK: (type $struct3 (sub $struct2 (struct (field (mut i32)) (field f64) (field anyref))))
(type $struct3 (struct_subtype (mut i32) f64 anyref $struct2))
;; CHECK: (type $none_=>_none (func))
@@ -1404,10 +1404,10 @@
;; CHECK: (type $struct1 (struct (field (mut i32))))
(type $struct1 (struct (mut i32)))
- ;; CHECK: (type $struct2 (struct_subtype (field (mut i32)) (field f64) $struct1))
+ ;; CHECK: (type $struct2 (sub $struct1 (struct (field (mut i32)) (field f64))))
(type $struct2 (struct_subtype (mut i32) f64 $struct1))
- ;; CHECK: (type $struct3 (struct_subtype (field (mut i32)) (field f64) (field anyref) $struct2))
+ ;; CHECK: (type $struct3 (sub $struct2 (struct (field (mut i32)) (field f64) (field anyref))))
(type $struct3 (struct_subtype (mut i32) f64 anyref $struct2))
;; CHECK: (type $ref?|$struct2|_=>_none (func (param (ref null $struct2))))
@@ -1630,10 +1630,10 @@
;; CHECK: (type $A (struct (field (mut i32))))
(type $A (struct (mut i32)))
- ;; CHECK: (type $B (struct_subtype (field (mut i32)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (mut i32)))))
(type $B (struct_subtype (mut i32) $A))
- ;; CHECK: (type $C (struct_subtype (field (mut i32)) $B))
+ ;; CHECK: (type $C (sub $B (struct (field (mut i32)))))
(type $C (struct_subtype (mut i32) $B))
;; CHECK: (type $none_=>_none (func))
@@ -2228,7 +2228,7 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $A (struct (field (mut i32))))
(type $A (struct (field (mut i32))))
- ;; CHECK: (type $B (struct_subtype (field (mut i32)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (mut i32)))))
(type $B (struct_subtype (field (mut i32)) $A))
)
diff --git a/test/lit/passes/coalesce-locals-gc.wast b/test/lit/passes/coalesce-locals-gc.wast
index 38840f1ea..5c91057f1 100644
--- a/test/lit/passes/coalesce-locals-gc.wast
+++ b/test/lit/passes/coalesce-locals-gc.wast
@@ -15,7 +15,7 @@
(type $A (struct_subtype (field (ref null struct)) data))
- ;; CHECK: (type $B (struct_subtype (field (ref struct)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (ref struct)))))
(type $B (struct_subtype (field (ref struct)) $A))
;; CHECK: (global $global (ref null $array) (ref.null none))
diff --git a/test/lit/passes/dae-gc-refine-params.wast b/test/lit/passes/dae-gc-refine-params.wast
index 6ab0dc346..6bc7324ef 100644
--- a/test/lit/passes/dae-gc-refine-params.wast
+++ b/test/lit/passes/dae-gc-refine-params.wast
@@ -5,14 +5,14 @@
;; CHECK: (type ${} (struct ))
(type ${} (struct))
- ;; CHECK: (type ${i32} (struct_subtype (field i32) ${}))
+ ;; CHECK: (type ${i32} (sub ${} (struct (field i32))))
(type ${i32} (struct_subtype (field i32) ${}))
- ;; CHECK: (type ${i32_i64} (struct_subtype (field i32) (field i64) ${i32}))
+ ;; CHECK: (type ${i32_i64} (sub ${i32} (struct (field i32) (field i64))))
- ;; CHECK: (type ${i32_f32} (struct_subtype (field i32) (field f32) ${i32}))
+ ;; CHECK: (type ${i32_f32} (sub ${i32} (struct (field i32) (field f32))))
- ;; CHECK: (type ${f64} (struct_subtype (field f64) ${}))
+ ;; CHECK: (type ${f64} (sub ${} (struct (field f64))))
(type ${f64} (struct_subtype (field f64) ${}))
(type ${i32_i64} (struct_subtype (field i32) (field i64) ${i32}))
diff --git a/test/lit/passes/dae-gc-refine-return.wast b/test/lit/passes/dae-gc-refine-return.wast
index 5aa3c0885..0487392de 100644
--- a/test/lit/passes/dae-gc-refine-return.wast
+++ b/test/lit/passes/dae-gc-refine-return.wast
@@ -8,13 +8,13 @@
;; CHECK: (type $return_{} (func (result (ref ${}))))
(type $return_{} (func (result (ref ${}))))
- ;; CHECK: (type ${i32} (struct_subtype (field i32) ${}))
+ ;; CHECK: (type ${i32} (sub ${} (struct (field i32))))
(type ${i32} (struct_subtype (field i32) ${}))
- ;; CHECK: (type ${i32_f32} (struct_subtype (field i32) (field f32) ${i32}))
+ ;; CHECK: (type ${i32_f32} (sub ${i32} (struct (field i32) (field f32))))
(type ${i32_f32} (struct_subtype (field i32) (field f32) ${i32}))
- ;; CHECK: (type ${i32_i64} (struct_subtype (field i32) (field i64) ${i32}))
+ ;; CHECK: (type ${i32_i64} (sub ${i32} (struct (field i32) (field i64))))
(type ${i32_i64} (struct_subtype (field i32) (field i64) ${i32}))
(table 1 1 funcref)
diff --git a/test/lit/passes/gsi.wast b/test/lit/passes/gsi.wast
index 466594ba5..49bb897d1 100644
--- a/test/lit/passes/gsi.wast
+++ b/test/lit/passes/gsi.wast
@@ -672,7 +672,7 @@
;; CHECK: (type $ref?|$struct|_=>_none (func (param (ref null $struct))))
- ;; CHECK: (type $sub-struct (struct_subtype (field i32) $struct))
+ ;; CHECK: (type $sub-struct (sub $struct (struct (field i32))))
(type $sub-struct (struct_subtype i32 $struct))
;; CHECK: (global $global1 (ref $struct) (struct.new $struct
@@ -721,7 +721,7 @@
;; CHECK: (type $super-struct (struct (field i32)))
(type $super-struct (struct_subtype i32 data))
- ;; CHECK: (type $struct (struct_subtype (field i32) $super-struct))
+ ;; CHECK: (type $struct (sub $super-struct (struct (field i32))))
(type $struct (struct_subtype i32 $super-struct))
;; CHECK: (type $ref?|$struct|_=>_none (func (param (ref null $struct))))
@@ -779,7 +779,7 @@
;; CHECK: (type $super-struct (struct (field i32)))
(type $super-struct (struct_subtype i32 data))
- ;; CHECK: (type $struct (struct_subtype (field i32) $super-struct))
+ ;; CHECK: (type $struct (sub $super-struct (struct (field i32))))
(type $struct (struct_subtype i32 $super-struct))
;; CHECK: (type $ref?|$struct|_ref?|$super-struct|_=>_none (func (param (ref null $struct) (ref null $super-struct))))
@@ -890,10 +890,10 @@
;; CHECK: (type $super-struct (struct (field i32)))
(type $super-struct (struct_subtype i32 data))
- ;; CHECK: (type $struct1 (struct_subtype (field i32) (field f32) $super-struct))
+ ;; CHECK: (type $struct1 (sub $super-struct (struct (field i32) (field f32))))
(type $struct1 (struct_subtype i32 f32 $super-struct))
- ;; CHECK: (type $struct2 (struct_subtype (field i32) (field f64) $super-struct))
+ ;; CHECK: (type $struct2 (sub $super-struct (struct (field i32) (field f64))))
(type $struct2 (struct_subtype i32 f64 $super-struct))
@@ -983,10 +983,10 @@
;; CHECK: (type $super-struct (struct (field i32)))
(type $super-struct (struct_subtype i32 data))
- ;; CHECK: (type $struct1 (struct_subtype (field i32) (field f32) $super-struct))
+ ;; CHECK: (type $struct1 (sub $super-struct (struct (field i32) (field f32))))
(type $struct1 (struct_subtype i32 f32 $super-struct))
- ;; CHECK: (type $struct2 (struct_subtype (field i32) (field f64) $super-struct))
+ ;; CHECK: (type $struct2 (sub $super-struct (struct (field i32) (field f64))))
(type $struct2 (struct_subtype i32 f64 $super-struct))
@@ -1231,10 +1231,10 @@
;; CHECK-NEXT: (type $struct (struct (field i32)))
(type $struct (struct_subtype i32 data))
- ;; CHECK: (type $sub-struct1 (struct_subtype (field i32) $struct))
+ ;; CHECK: (type $sub-struct1 (sub $struct (struct (field i32))))
(type $sub-struct1 (struct_subtype i32 $struct))
- ;; CHECK: (type $sub-struct2 (struct_subtype (field i32) $struct))
+ ;; CHECK: (type $sub-struct2 (sub $struct (struct (field i32))))
(type $sub-struct2 (struct_subtype i32 $struct))
)
@@ -1285,10 +1285,10 @@
;; CHECK-NEXT: (type $struct (struct (field i32)))
(type $struct (struct_subtype i32 data))
- ;; CHECK: (type $sub-struct1 (struct_subtype (field i32) $struct))
+ ;; CHECK: (type $sub-struct1 (sub $struct (struct (field i32))))
(type $sub-struct1 (struct_subtype i32 $struct))
- ;; CHECK: (type $sub-struct2 (struct_subtype (field i32) $struct))
+ ;; CHECK: (type $sub-struct2 (sub $struct (struct (field i32))))
(type $sub-struct2 (struct_subtype i32 $struct))
)
@@ -1342,10 +1342,10 @@
;; CHECK-NEXT: (type $struct (struct (field i32)))
(type $struct (struct_subtype i32 data))
- ;; CHECK: (type $sub-struct1 (struct_subtype (field i32) $struct))
+ ;; CHECK: (type $sub-struct1 (sub $struct (struct (field i32))))
(type $sub-struct1 (struct_subtype i32 $struct))
- ;; CHECK: (type $sub-struct2 (struct_subtype (field i32) $struct))
+ ;; CHECK: (type $sub-struct2 (sub $struct (struct (field i32))))
(type $sub-struct2 (struct_subtype i32 $struct))
)
diff --git a/test/lit/passes/gto-mutability.wast b/test/lit/passes/gto-mutability.wast
index 93276bad0..a77d8c271 100644
--- a/test/lit/passes/gto-mutability.wast
+++ b/test/lit/passes/gto-mutability.wast
@@ -433,7 +433,7 @@
;; CHECK: (type $super (struct (field i32)))
(type $super (struct (field (mut i32))))
- ;; CHECK: (type $sub (struct_subtype (field i32) $super))
+ ;; CHECK: (type $sub (sub $super (struct (field i32))))
(type $sub (struct_subtype (field (mut i32)) $super))
;; CHECK: (type $none_=>_none (func))
@@ -487,7 +487,7 @@
;; CHECK: (type $super (struct (field (mut i32))))
(type $super (struct (field (mut i32))))
- ;; CHECK: (type $sub (struct_subtype (field (mut i32)) $super))
+ ;; CHECK: (type $sub (sub $super (struct (field (mut i32)))))
(type $sub (struct_subtype (field (mut i32)) $super))
;; CHECK: (type $ref|$super|_=>_none (func (param (ref $super))))
@@ -552,7 +552,7 @@
;; CHECK: (type $super (struct (field (mut i32))))
(type $super (struct (field (mut i32))))
- ;; CHECK: (type $sub (struct_subtype (field (mut i32)) $super))
+ ;; CHECK: (type $sub (sub $super (struct (field (mut i32)))))
(type $sub (struct_subtype (field (mut i32)) $super))
;; CHECK: (type $ref|$sub|_=>_none (func (param (ref $sub))))
diff --git a/test/lit/passes/gto-removals.wast b/test/lit/passes/gto-removals.wast
index f422cc542..2df9ddc3f 100644
--- a/test/lit/passes/gto-removals.wast
+++ b/test/lit/passes/gto-removals.wast
@@ -638,7 +638,7 @@
;; CHECK-NEXT: (type $parent (struct (field i32) (field i64)))
(type $parent (struct_subtype (field i32) (field i64) (field f32) (field f64) data))
- ;; CHECK: (type $child (struct_subtype (field i32) (field i64) (field f32) (field f64) (field anyref) $parent))
+ ;; CHECK: (type $child (sub $parent (struct (field i32) (field i64) (field f32) (field f64) (field anyref))))
(type $child (struct_subtype (field i32) (field i64) (field f32) (field f64) (field anyref) $parent))
;; CHECK: (type $ref|$parent|_ref|$child|_=>_none (func (param (ref $parent) (ref $child))))
@@ -688,7 +688,7 @@
;; CHECK-NEXT: (type $parent (struct (field i32) (field i64) (field (mut f32))))
(type $parent (struct_subtype (field (mut i32)) (field (mut i64)) (field (mut f32)) (field (mut f64)) data))
- ;; CHECK: (type $child (struct_subtype (field i32) (field i64) (field (mut f32)) (field f64) (field anyref) $parent))
+ ;; CHECK: (type $child (sub $parent (struct (field i32) (field i64) (field (mut f32)) (field f64) (field anyref))))
(type $child (struct_subtype (field (mut i32)) (field (mut i64)) (field (mut f32)) (field (mut f64)) (field (mut anyref)) $parent))
;; CHECK: (type $ref|$parent|_ref|$child|_=>_none (func (param (ref $parent) (ref $child))))
@@ -745,9 +745,9 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $parent (struct (field i32)))
(type $parent (struct_subtype (field i32) data))
- ;; CHECK: (type $child1 (struct_subtype (field i32) $parent))
+ ;; CHECK: (type $child1 (sub $parent (struct (field i32))))
(type $child1 (struct_subtype (field i32) $parent))
- ;; CHECK: (type $child2 (struct_subtype (field i32) $parent))
+ ;; CHECK: (type $child2 (sub $parent (struct (field i32))))
(type $child2 (struct_subtype (field i32) $parent))
)
@@ -773,9 +773,9 @@
;; CHECK-NEXT: (type $parent (struct ))
(type $parent (struct_subtype (field i32) data))
- ;; CHECK: (type $child2 (struct_subtype $parent))
+ ;; CHECK: (type $child2 (sub $parent (struct )))
- ;; CHECK: (type $child1 (struct_subtype (field i32) $parent))
+ ;; CHECK: (type $child1 (sub $parent (struct (field i32))))
(type $child1 (struct_subtype (field i32) $parent))
(type $child2 (struct_subtype (field i32) $parent))
)
diff --git a/test/lit/passes/gufa-refs.wast b/test/lit/passes/gufa-refs.wast
index 6fb372d72..928796823 100644
--- a/test/lit/passes/gufa-refs.wast
+++ b/test/lit/passes/gufa-refs.wast
@@ -928,7 +928,7 @@
;; CHECK: (type $parent (struct (field (mut (ref null $struct)))))
(type $parent (struct_subtype (field (mut (ref null $struct))) data))
- ;; CHECK: (type $child (struct_subtype (field (mut (ref null $struct))) (field (mut (ref null $struct))) $parent))
+ ;; CHECK: (type $child (sub $parent (struct (field (mut (ref null $struct))) (field (mut (ref null $struct))))))
(type $child (struct_subtype (field (mut (ref null $struct))) (field (mut (ref null $struct))) $parent))
;; CHECK: (type $unrelated (struct ))
@@ -1205,7 +1205,7 @@
(type $struct (struct_subtype data))
;; CHECK: (type $parent (struct (field (mut (ref null $struct)))))
(type $parent (struct_subtype (field (mut (ref null $struct))) data))
- ;; CHECK: (type $child (struct_subtype (field (mut (ref null $struct))) (field i32) $parent))
+ ;; CHECK: (type $child (sub $parent (struct (field (mut (ref null $struct))) (field i32))))
(type $child (struct_subtype (field (mut (ref null $struct))) (field i32) $parent))
;; CHECK: (type $none_=>_none (func))
@@ -1287,7 +1287,7 @@
(module
;; CHECK: (type $parent (struct (field (mut i32))))
(type $parent (struct_subtype (field (mut i32)) data))
- ;; CHECK: (type $child (struct_subtype (field (mut i32)) (field i32) $parent))
+ ;; CHECK: (type $child (sub $parent (struct (field (mut i32)) (field i32))))
(type $child (struct_subtype (field (mut i32)) (field i32) $parent))
;; CHECK: (type $none_=>_none (func))
@@ -1379,7 +1379,7 @@
(module
;; CHECK: (type $parent (struct (field (mut i32))))
(type $parent (struct_subtype (field (mut i32)) data))
- ;; CHECK: (type $child (struct_subtype (field (mut i32)) (field i32) $parent))
+ ;; CHECK: (type $child (sub $parent (struct (field (mut i32)) (field i32))))
(type $child (struct_subtype (field (mut i32)) (field i32) $parent))
;; CHECK: (type $i32_=>_none (func (param i32)))
@@ -1462,7 +1462,7 @@
(module
;; CHECK: (type $parent (struct (field (mut i32))))
(type $parent (struct_subtype (field (mut i32)) data))
- ;; CHECK: (type $child (struct_subtype (field (mut i32)) (field i32) $parent))
+ ;; CHECK: (type $child (sub $parent (struct (field (mut i32)) (field i32))))
(type $child (struct_subtype (field (mut i32)) (field i32) $parent))
;; CHECK: (type $none_=>_none (func))
@@ -1547,7 +1547,7 @@
;; CHECK: (type $something (array (mut anyref)))
(type $something (array_subtype (mut (ref null any)) data))
- ;; CHECK: (type $something-child (array_subtype (mut anyref) $something))
+ ;; CHECK: (type $something-child (sub $something (array (mut anyref))))
(type $something-child (array_subtype (mut (ref null any)) $something))
)
@@ -2448,11 +2448,11 @@
(module
;; CHECK: (type $struct (struct (field i32)))
(type $struct (struct_subtype (field i32) data))
- ;; CHECK: (type $substruct (struct_subtype (field i32) (field i32) $struct))
+ ;; CHECK: (type $substruct (sub $struct (struct (field i32) (field i32))))
(type $substruct (struct_subtype (field i32) (field i32) $struct))
;; CHECK: (type $none_=>_none (func))
- ;; CHECK: (type $subsubstruct (struct_subtype (field i32) (field i32) (field i32) $substruct))
+ ;; CHECK: (type $subsubstruct (sub $substruct (struct (field i32) (field i32) (field i32))))
(type $subsubstruct (struct_subtype (field i32) (field i32) (field i32) $substruct))
;; CHECK: (type $i32_=>_none (func (param i32)))
@@ -3564,7 +3564,7 @@
(module
;; CHECK: (type $A (struct (field i32)))
(type $A (struct_subtype (field i32) data))
- ;; CHECK: (type $B (struct_subtype (field i32) (field f64) $A))
+ ;; CHECK: (type $B (sub $A (struct (field i32) (field f64))))
(type $B (struct_subtype (field i32) (field f64) $A))
;; CHECK: (type $none_=>_i32 (func (result i32)))
@@ -3612,7 +3612,7 @@
(type $A (struct_subtype (field i32) data))
;; CHECK: (type $none_=>_i32 (func (result i32)))
- ;; CHECK: (type $B (struct_subtype (field i32) (field i32) $A))
+ ;; CHECK: (type $B (sub $A (struct (field i32) (field i32))))
(type $B (struct_subtype (field i32) (field i32) $A))
;; CHECK: (func $0 (type $none_=>_i32) (result i32)
;; CHECK-NEXT: (local $ref (ref null $A))
@@ -4224,7 +4224,7 @@
;; CHECK: (type $struct (struct (field (mut i32))))
(type $struct (struct_subtype (mut i32) data))
- ;; CHECK: (type $substruct (struct_subtype (field (mut i32)) (field f64) $struct))
+ ;; CHECK: (type $substruct (sub $struct (struct (field (mut i32)) (field f64))))
(type $substruct (struct_subtype (mut i32) f64 $struct))
;; CHECK: (type $none_=>_none (func))
@@ -4300,7 +4300,7 @@
;; CHECK: (type $struct (struct (field (mut i32))))
(type $struct (struct_subtype (mut i32) data))
- ;; CHECK: (type $substruct (struct_subtype (field (mut i32)) (field f64) $struct))
+ ;; CHECK: (type $substruct (sub $struct (struct (field (mut i32)) (field f64))))
(type $substruct (struct_subtype (mut i32) f64 $struct))
;; CHECK: (type $none_=>_none (func))
@@ -4378,7 +4378,7 @@
;; CHECK: (type $struct (struct (field (mut i32))))
(type $struct (struct_subtype (mut i32) data))
- ;; CHECK: (type $substruct (struct_subtype (field (mut i32)) (field f64) $struct))
+ ;; CHECK: (type $substruct (sub $struct (struct (field (mut i32)) (field f64))))
(type $substruct (struct_subtype (mut i32) f64 $struct))
;; CHECK: (type $none_=>_none (func))
@@ -4585,9 +4585,9 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $A (struct (field (mut i32))))
(type $A (struct_subtype (field (mut i32)) data))
- ;; CHECK: (type $B (struct_subtype (field (mut i32)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (mut i32)))))
(type $B (struct_subtype (field (mut i32)) $A))
- ;; CHECK: (type $C (struct_subtype (field (mut i32)) $B))
+ ;; CHECK: (type $C (sub $B (struct (field (mut i32)))))
(type $C (struct_subtype (field (mut i32)) $B))
)
@@ -4693,9 +4693,9 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $A (struct (field (mut i32))))
(type $A (struct_subtype (field (mut i32)) data))
- ;; CHECK: (type $B (struct_subtype (field (mut i32)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (mut i32)))))
(type $B (struct_subtype (field (mut i32)) $A))
- ;; CHECK: (type $C (struct_subtype (field (mut i32)) $B))
+ ;; CHECK: (type $C (sub $B (struct (field (mut i32)))))
(type $C (struct_subtype (field (mut i32)) $B))
)
@@ -4801,9 +4801,9 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $A (struct (field (mut i32))))
(type $A (struct_subtype (field (mut i32)) data))
- ;; CHECK: (type $B (struct_subtype (field (mut i32)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (mut i32)))))
(type $B (struct_subtype (field (mut i32)) $A))
- ;; CHECK: (type $C (struct_subtype (field (mut i32)) $A))
+ ;; CHECK: (type $C (sub $A (struct (field (mut i32)))))
(type $C (struct_subtype (field (mut i32)) $A)) ;; This line changed.
)
@@ -4915,9 +4915,9 @@
(module
;; CHECK: (type $A (struct (field (mut i32))))
(type $A (struct_subtype (field (mut i32)) data))
- ;; CHECK: (type $B (struct_subtype (field (mut i32)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (mut i32)))))
(type $B (struct_subtype (field (mut i32)) $A))
- ;; CHECK: (type $C (struct_subtype (field (mut i32)) $B))
+ ;; CHECK: (type $C (sub $B (struct (field (mut i32)))))
(type $C (struct_subtype (field (mut i32)) $B))
;; CHECK: (type $i32_=>_none (func (param i32)))
@@ -5013,9 +5013,9 @@
(module
;; CHECK: (type $A (struct (field (mut i32))))
(type $A (struct_subtype (field (mut i32)) data))
- ;; CHECK: (type $B (struct_subtype (field (mut i32)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (mut i32)))))
(type $B (struct_subtype (field (mut i32)) $A))
- ;; CHECK: (type $C (struct_subtype (field (mut i32)) $B))
+ ;; CHECK: (type $C (sub $B (struct (field (mut i32)))))
(type $C (struct_subtype (field (mut i32)) $B))
;; CHECK: (type $i32_=>_none (func (param i32)))
@@ -5112,9 +5112,9 @@
(module
;; CHECK: (type $A (struct (field (mut i32))))
(type $A (struct_subtype (field (mut i32)) data))
- ;; CHECK: (type $B (struct_subtype (field (mut i32)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (mut i32)))))
(type $B (struct_subtype (field (mut i32)) $A))
- ;; CHECK: (type $C (struct_subtype (field (mut i32)) $B))
+ ;; CHECK: (type $C (sub $B (struct (field (mut i32)))))
(type $C (struct_subtype (field (mut i32)) $B))
;; CHECK: (type $i32_=>_none (func (param i32)))
@@ -5213,7 +5213,7 @@
;; CHECK: (type $A (struct (field (mut i32))))
(type $A (struct_subtype (field (mut i32)) data))
- ;; CHECK: (type $B (struct_subtype (field (mut i32)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (mut i32)))))
(type $B (struct_subtype (field (mut i32)) $A))
;; CHECK: (type $ref|$A|_=>_none (func (param (ref $A))))
diff --git a/test/lit/passes/gufa-vs-cfp.wast b/test/lit/passes/gufa-vs-cfp.wast
index ae63ac7ba..2171a9fc1 100644
--- a/test/lit/passes/gufa-vs-cfp.wast
+++ b/test/lit/passes/gufa-vs-cfp.wast
@@ -687,7 +687,7 @@
;; CHECK: (type $none_=>_none (func))
- ;; CHECK: (type $substruct (struct_subtype (field i32) (field f64) $struct))
+ ;; CHECK: (type $substruct (sub $struct (struct (field i32) (field f64))))
(type $substruct (struct_subtype i32 f64 $struct))
;; CHECK: (import "a" "b" (func $import (type $none_=>_i32) (result i32)))
@@ -741,7 +741,7 @@
;; CHECK: (type $none_=>_none (func))
- ;; CHECK: (type $substruct (struct_subtype (field i32) (field f64) $struct))
+ ;; CHECK: (type $substruct (sub $struct (struct (field i32) (field f64))))
(type $substruct (struct_subtype i32 f64 $struct))
;; CHECK: (import "a" "b" (func $import (type $none_=>_i32) (result i32)))
@@ -789,7 +789,7 @@
;; CHECK: (type $struct (struct (field i32)))
(type $struct (struct i32))
- ;; CHECK: (type $substruct (struct_subtype (field i32) (field f64) $struct))
+ ;; CHECK: (type $substruct (sub $struct (struct (field i32) (field f64))))
(type $substruct (struct_subtype i32 f64 $struct))
;; CHECK: (type $none_=>_i32 (func (result i32)))
@@ -846,7 +846,7 @@
;; CHECK: (type $struct (struct (field (mut i32))))
(type $struct (struct (mut i32)))
- ;; CHECK: (type $substruct (struct_subtype (field (mut i32)) (field f64) $struct))
+ ;; CHECK: (type $substruct (sub $struct (struct (field (mut i32)) (field f64))))
(type $substruct (struct_subtype (mut i32) f64 $struct))
;; CHECK: (type $none_=>_i32 (func (result i32)))
@@ -918,7 +918,7 @@
;; CHECK: (type $struct (struct (field (mut i32))))
(type $struct (struct (mut i32)))
- ;; CHECK: (type $substruct (struct_subtype (field (mut i32)) (field f64) $struct))
+ ;; CHECK: (type $substruct (sub $struct (struct (field (mut i32)) (field f64))))
(type $substruct (struct_subtype (mut i32) f64 $struct))
;; CHECK: (type $none_=>_i32 (func (result i32)))
@@ -995,10 +995,10 @@
;; CHECK: (type $struct1 (struct (field i32)))
(type $struct1 (struct_subtype i32 data))
- ;; CHECK: (type $struct2 (struct_subtype (field i32) (field f64) $struct1))
+ ;; CHECK: (type $struct2 (sub $struct1 (struct (field i32) (field f64))))
(type $struct2 (struct_subtype i32 f64 $struct1))
- ;; CHECK: (type $struct3 (struct_subtype (field i32) (field f64) (field anyref) $struct2))
+ ;; CHECK: (type $struct3 (sub $struct2 (struct (field i32) (field f64) (field anyref))))
(type $struct3 (struct_subtype i32 f64 anyref $struct2))
;; CHECK: (type $none_=>_ref|$struct3| (func (result (ref $struct3))))
@@ -1136,10 +1136,10 @@
;; CHECK: (type $struct1 (struct (field i32) (field i32)))
(type $struct1 (struct i32 i32))
- ;; CHECK: (type $struct2 (struct_subtype (field i32) (field i32) (field f64) (field f64) $struct1))
+ ;; CHECK: (type $struct2 (sub $struct1 (struct (field i32) (field i32) (field f64) (field f64))))
(type $struct2 (struct_subtype i32 i32 f64 f64 $struct1))
- ;; CHECK: (type $struct3 (struct_subtype (field i32) (field i32) (field f64) (field f64) (field anyref) (field anyref) $struct2))
+ ;; CHECK: (type $struct3 (sub $struct2 (struct (field i32) (field i32) (field f64) (field f64) (field anyref) (field anyref))))
(type $struct3 (struct_subtype i32 i32 f64 f64 anyref anyref $struct2))
;; CHECK: (type $none_=>_none (func))
@@ -1369,11 +1369,11 @@
(module
;; CHECK: (type $struct1 (struct (field (mut i32))))
(type $struct1 (struct (mut i32)))
- ;; CHECK: (type $struct2 (struct_subtype (field (mut i32)) (field f64) $struct1))
+ ;; CHECK: (type $struct2 (sub $struct1 (struct (field (mut i32)) (field f64))))
(type $struct2 (struct_subtype (mut i32) f64 $struct1))
;; CHECK: (type $none_=>_none (func))
- ;; CHECK: (type $struct3 (struct_subtype (field (mut i32)) (field f64) (field anyref) $struct2))
+ ;; CHECK: (type $struct3 (sub $struct2 (struct (field (mut i32)) (field f64) (field anyref))))
(type $struct3 (struct_subtype (mut i32) f64 anyref $struct2))
;; CHECK: (type $none_=>_i32 (func (result i32)))
@@ -1674,9 +1674,9 @@
(module
;; CHECK: (type $struct1 (struct (field (mut i32))))
(type $struct1 (struct (mut i32)))
- ;; CHECK: (type $struct2 (struct_subtype (field (mut i32)) (field f64) $struct1))
+ ;; CHECK: (type $struct2 (sub $struct1 (struct (field (mut i32)) (field f64))))
(type $struct2 (struct_subtype (mut i32) f64 $struct1))
- ;; CHECK: (type $struct3 (struct_subtype (field (mut i32)) (field f64) (field anyref) $struct2))
+ ;; CHECK: (type $struct3 (sub $struct2 (struct (field (mut i32)) (field f64) (field anyref))))
(type $struct3 (struct_subtype (mut i32) f64 anyref $struct2))
;; CHECK: (type $none_=>_i32 (func (result i32)))
@@ -1790,9 +1790,9 @@
(module
;; CHECK: (type $struct1 (struct (field (mut i32))))
(type $struct1 (struct (mut i32)))
- ;; CHECK: (type $struct2 (struct_subtype (field (mut i32)) (field f64) $struct1))
+ ;; CHECK: (type $struct2 (sub $struct1 (struct (field (mut i32)) (field f64))))
(type $struct2 (struct_subtype (mut i32) f64 $struct1))
- ;; CHECK: (type $struct3 (struct_subtype (field (mut i32)) (field f64) (field anyref) $struct2))
+ ;; CHECK: (type $struct3 (sub $struct2 (struct (field (mut i32)) (field f64) (field anyref))))
(type $struct3 (struct_subtype (mut i32) f64 anyref $struct2))
;; CHECK: (type $none_=>_i32 (func (result i32)))
@@ -2018,10 +2018,10 @@
;; CHECK: (type $A (struct (field (mut i32))))
(type $A (struct (mut i32)))
- ;; CHECK: (type $B (struct_subtype (field (mut i32)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (mut i32)))))
(type $B (struct_subtype (mut i32) $A))
- ;; CHECK: (type $C (struct_subtype (field (mut i32)) $B))
+ ;; CHECK: (type $C (sub $B (struct (field (mut i32)))))
(type $C (struct_subtype (mut i32) $B))
;; CHECK: (type $none_=>_none (func))
diff --git a/test/lit/passes/monomorphize.wast b/test/lit/passes/monomorphize.wast
index 02a709c5a..006cd1703 100644
--- a/test/lit/passes/monomorphize.wast
+++ b/test/lit/passes/monomorphize.wast
@@ -10,8 +10,8 @@
;; ALWAYS: (type $A (struct ))
;; CAREFUL: (type $A (struct ))
(type $A (struct_subtype data))
- ;; ALWAYS: (type $B (struct_subtype $A))
- ;; CAREFUL: (type $B (struct_subtype $A))
+ ;; ALWAYS: (type $B (sub $A (struct )))
+ ;; CAREFUL: (type $B (sub $A (struct )))
(type $B (struct_subtype $A))
;; ALWAYS: (type $ref|$A|_=>_none (func (param (ref $A))))
@@ -129,8 +129,8 @@
;; CAREFUL: (type $A (struct ))
(type $A (struct_subtype data))
- ;; ALWAYS: (type $B (struct_subtype $A))
- ;; CAREFUL: (type $B (struct_subtype $A))
+ ;; ALWAYS: (type $B (sub $A (struct )))
+ ;; CAREFUL: (type $B (sub $A (struct )))
(type $B (struct_subtype $A))
@@ -209,16 +209,16 @@
;; CAREFUL: (type $A (struct ))
(type $A (struct_subtype data))
- ;; ALWAYS: (type $B (struct_subtype $A))
- ;; CAREFUL: (type $B (struct_subtype $A))
+ ;; ALWAYS: (type $B (sub $A (struct )))
+ ;; CAREFUL: (type $B (sub $A (struct )))
(type $B (struct_subtype $A))
;; ALWAYS: (type $none_=>_none (func))
- ;; ALWAYS: (type $C (struct_subtype $B))
+ ;; ALWAYS: (type $C (sub $B (struct )))
;; CAREFUL: (type $ref|$A|_=>_none (func (param (ref $A))))
- ;; CAREFUL: (type $C (struct_subtype $B))
+ ;; CAREFUL: (type $C (sub $B (struct )))
(type $C (struct_subtype $B))
;; ALWAYS: (type $ref|$A|_=>_none (func (param (ref $A))))
@@ -331,8 +331,8 @@
;; CAREFUL: (type $A (struct ))
(type $A (struct_subtype data))
- ;; ALWAYS: (type $B (struct_subtype $A))
- ;; CAREFUL: (type $B (struct_subtype $A))
+ ;; ALWAYS: (type $B (sub $A (struct )))
+ ;; CAREFUL: (type $B (sub $A (struct )))
(type $B (struct_subtype $A))
;; ALWAYS: (type $ref|$B|_=>_none (func (param (ref $B))))
@@ -563,10 +563,10 @@
(type $A (struct_subtype data))
;; ALWAYS: (type $ref|$A|_=>_none (func (param (ref $A))))
- ;; ALWAYS: (type $B (struct_subtype $A))
+ ;; ALWAYS: (type $B (sub $A (struct )))
;; CAREFUL: (type $ref|$A|_=>_none (func (param (ref $A))))
- ;; CAREFUL: (type $B (struct_subtype $A))
+ ;; CAREFUL: (type $B (sub $A (struct )))
(type $B (struct_subtype $A))
diff --git a/test/lit/passes/optimize-casts.wast b/test/lit/passes/optimize-casts.wast
index aefd4a6ea..4dd839d97 100644
--- a/test/lit/passes/optimize-casts.wast
+++ b/test/lit/passes/optimize-casts.wast
@@ -5,7 +5,7 @@
;; CHECK: (type $A (struct ))
(type $A (struct_subtype data))
- ;; CHECK: (type $B (struct_subtype $A))
+ ;; CHECK: (type $B (sub $A (struct )))
(type $B (struct_subtype $A))
;; CHECK: (type $D (array (mut i32)))
diff --git a/test/lit/passes/optimize-instructions-gc-iit.wast b/test/lit/passes/optimize-instructions-gc-iit.wast
index 23161f1be..4271d3de7 100644
--- a/test/lit/passes/optimize-instructions-gc-iit.wast
+++ b/test/lit/passes/optimize-instructions-gc-iit.wast
@@ -11,8 +11,8 @@
;; CHECK: (type $parent (struct (field i32)))
;; TNH: (type $parent (struct (field i32)))
(type $parent (struct (field i32)))
- ;; CHECK: (type $child (struct_subtype (field i32) (field f64) $parent))
- ;; TNH: (type $child (struct_subtype (field i32) (field f64) $parent))
+ ;; CHECK: (type $child (sub $parent (struct (field i32) (field f64))))
+ ;; TNH: (type $child (sub $parent (struct (field i32) (field f64))))
(type $child (struct_subtype (field i32) (field f64) $parent))
;; CHECK: (type $other (struct (field i64) (field f32)))
;; TNH: (type $other (struct (field i64) (field f32)))
@@ -204,14 +204,14 @@
;; TNH: (rec
;; TNH-NEXT: (type $A (struct ))
(type $A (struct_subtype data))
- ;; CHECK: (type $B (struct_subtype (field (ref null $A)) $A))
- ;; TNH: (type $B (struct_subtype (field (ref null $A)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (ref null $A)))))
+ ;; TNH: (type $B (sub $A (struct (field (ref null $A)))))
(type $B (struct_subtype (field (ref null $A)) $A))
- ;; CHECK: (type $C (struct_subtype (field (ref null $D)) $B))
- ;; TNH: (type $C (struct_subtype (field (ref null $D)) $B))
+ ;; CHECK: (type $C (sub $B (struct (field (ref null $D)))))
+ ;; TNH: (type $C (sub $B (struct (field (ref null $D)))))
(type $C (struct_subtype (field (ref null $D)) $B))
- ;; CHECK: (type $D (struct_subtype $A))
- ;; TNH: (type $D (struct_subtype $A))
+ ;; CHECK: (type $D (sub $A (struct )))
+ ;; TNH: (type $D (sub $A (struct )))
(type $D (struct_subtype $A))
)
diff --git a/test/lit/passes/optimize-instructions-gc.wast b/test/lit/passes/optimize-instructions-gc.wast
index c581c7e42..107093772 100644
--- a/test/lit/passes/optimize-instructions-gc.wast
+++ b/test/lit/passes/optimize-instructions-gc.wast
@@ -15,7 +15,7 @@
;; CHECK: (type $A (struct (field i32)))
(type $A (struct (field i32)))
- ;; CHECK: (type $B (struct_subtype (field i32) (field i32) (field f32) $A))
+ ;; CHECK: (type $B (sub $A (struct (field i32) (field i32) (field f32))))
;; CHECK: (type $array (array (mut i8)))
(type $array (array (mut i8)))
@@ -24,14 +24,14 @@
;; CHECK: (type $void (func))
- ;; CHECK: (type $B-child (struct_subtype (field i32) (field i32) (field f32) (field i64) $B))
+ ;; CHECK: (type $B-child (sub $B (struct (field i32) (field i32) (field f32) (field i64))))
(type $B-child (struct_subtype (field i32) (field i32) (field f32) (field i64) $B))
(type $empty (struct))
- ;; CHECK: (type $void2 (func_subtype $void))
+ ;; CHECK: (type $void2 (sub $void (func)))
- ;; CHECK: (type $C (struct_subtype (field i32) (field i32) (field f64) $A))
+ ;; CHECK: (type $C (sub $A (struct (field i32) (field i32) (field f64))))
(type $C (struct_subtype (field i32) (field i32) (field f64) $A))
(type $void (func))
diff --git a/test/lit/passes/remove-unused-module-elements-refs.wast b/test/lit/passes/remove-unused-module-elements-refs.wast
index f9d1bc3fd..a56350ddc 100644
--- a/test/lit/passes/remove-unused-module-elements-refs.wast
+++ b/test/lit/passes/remove-unused-module-elements-refs.wast
@@ -14,12 +14,12 @@
;; OPEN_WORLD-NEXT: (type $A-super (func))
(type $A-super (func))
- ;; CHECK: (type $A (func_subtype $A-super))
- ;; OPEN_WORLD: (type $A (func_subtype $A-super))
+ ;; CHECK: (type $A (sub $A-super (func)))
+ ;; OPEN_WORLD: (type $A (sub $A-super (func)))
(type $A (func_subtype $A-super))
- ;; CHECK: (type $A-sub (func_subtype $A))
- ;; OPEN_WORLD: (type $A-sub (func_subtype $A))
+ ;; CHECK: (type $A-sub (sub $A (func)))
+ ;; OPEN_WORLD: (type $A-sub (sub $A (func)))
(type $A-sub (func_subtype $A))
;; CHECK: (type $B (func))
@@ -1372,12 +1372,12 @@
;; OPEN_WORLD: (type $struct (struct (field funcref)))
(type $struct (struct (field funcref)))
- ;; CHECK: (type $substruct (struct_subtype (field funcref) $struct))
- ;; OPEN_WORLD: (type $substruct (struct_subtype (field funcref) $struct))
+ ;; CHECK: (type $substruct (sub $struct (struct (field funcref))))
+ ;; OPEN_WORLD: (type $substruct (sub $struct (struct (field funcref))))
(type $substruct (struct_subtype (field funcref) $struct))
- ;; CHECK: (type $subsubstruct (struct_subtype (field funcref) $substruct))
- ;; OPEN_WORLD: (type $subsubstruct (struct_subtype (field funcref) $substruct))
+ ;; CHECK: (type $subsubstruct (sub $substruct (struct (field funcref))))
+ ;; OPEN_WORLD: (type $subsubstruct (sub $substruct (struct (field funcref))))
(type $subsubstruct (struct_subtype (field funcref) $substruct))
;; CHECK: (global $g (ref $struct) (struct.new $struct
diff --git a/test/lit/passes/roundtrip-gc-types.wast b/test/lit/passes/roundtrip-gc-types.wast
index 48876c7cf..8bb8428ce 100644
--- a/test/lit/passes/roundtrip-gc-types.wast
+++ b/test/lit/passes/roundtrip-gc-types.wast
@@ -18,7 +18,7 @@
;; CHECK: (type $C (struct (field (mut (ref $B)))))
(type $C (struct (field (mut (ref $B)))))
- ;; CHECK: (type $D (struct_subtype (field (ref $C)) (field (ref $A)) $A))
+ ;; CHECK: (type $D (sub $A (struct (field (ref $C)) (field (ref $A)))))
(type $D (struct_subtype (field (ref $C)) (field (ref $A)) $A))
)
diff --git a/test/lit/passes/rse-gc.wast b/test/lit/passes/rse-gc.wast
index c74e92c5e..e5d92abc9 100644
--- a/test/lit/passes/rse-gc.wast
+++ b/test/lit/passes/rse-gc.wast
@@ -7,7 +7,7 @@
;; $B is a subtype of $A, and its field has a more refined type (it is non-
;; nullable).
- ;; CHECK: (type $B (struct_subtype (field (ref struct)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (ref struct)))))
(type $B (struct_subtype (field (ref struct)) $A))
;; CHECK: (func $test (type $none_=>_none)
diff --git a/test/lit/passes/signature-pruning.wast b/test/lit/passes/signature-pruning.wast
index 12477c2cd..63ca1ad0f 100644
--- a/test/lit/passes/signature-pruning.wast
+++ b/test/lit/passes/signature-pruning.wast
@@ -886,16 +886,16 @@
(type $struct.A (struct (field i32)))
;; CHECK: (type $array.A (array (ref $struct.A)))
- ;; CHECK: (type $struct.B (struct_subtype (field i32) (field i64) $struct.A))
+ ;; CHECK: (type $struct.B (sub $struct.A (struct (field i32) (field i64))))
(type $struct.B (struct_subtype (field i32) (field i64) $struct.A))
(type $array.A (array (ref $struct.A)))
- ;; CHECK: (type $array.B (array_subtype (ref $struct.B) $array.A))
+ ;; CHECK: (type $array.B (sub $array.A (array (ref $struct.B))))
(type $array.B (array_subtype (ref $struct.B) $array.A))
;; CHECK: (type $func.A (func (param (ref $array.B)) (result (ref $array.A))))
(type $func.A (func (param (ref $array.B)) (result (ref $array.A))))
- ;; CHECK: (type $func.B (func_subtype (param (ref $array.A)) (result (ref $array.B)) $func.A))
+ ;; CHECK: (type $func.B (sub $func.A (func (param (ref $array.A)) (result (ref $array.B)))))
(type $func.B (func_subtype (param (ref $array.A)) (result (ref $array.B)) $func.A))
;; CHECK: (func $func.A (type $func.A) (param $0 (ref $array.B)) (result (ref $array.A))
diff --git a/test/lit/passes/signature-refining.wast b/test/lit/passes/signature-refining.wast
index 0f12cbde0..1b575174d 100644
--- a/test/lit/passes/signature-refining.wast
+++ b/test/lit/passes/signature-refining.wast
@@ -123,9 +123,9 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $struct (struct ))
- ;; CHECK: (type $struct-sub2 (struct_subtype $struct))
+ ;; CHECK: (type $struct-sub2 (sub $struct (struct )))
- ;; CHECK: (type $struct-sub1 (struct_subtype $struct))
+ ;; CHECK: (type $struct-sub1 (sub $struct (struct )))
;; CHECK: (type $none_=>_none (func))
@@ -692,7 +692,7 @@
(module
;; CHECK: (type $A (func (param i32)))
(type $A (func_subtype (param i32) func))
- ;; CHECK: (type $B (func_subtype (param i32) $A))
+ ;; CHECK: (type $B (sub $A (func (param i32))))
(type $B (func_subtype (param i32) $A))
;; CHECK: (func $bar (type $B) (param $x i32)
@@ -785,7 +785,7 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $A (func (param (ref null $B)) (result (ref null $A))))
(type $A (func (param (ref null $B)) (result (ref null $A))))
- ;; CHECK: (type $B (func_subtype (param (ref null $A)) (result (ref null $B)) $A))
+ ;; CHECK: (type $B (sub $A (func (param (ref null $A)) (result (ref null $B)))))
(type $B (func_subtype (param (ref null $A)) (result (ref null $B)) $A))
)
@@ -807,7 +807,7 @@
(module
;; CHECK: (type $parent (func (param anyref)))
(type $parent (func (param anyref)))
- ;; CHECK: (type $child (func_subtype (param anyref) $parent))
+ ;; CHECK: (type $child (sub $parent (func (param anyref))))
(type $child (func_subtype (param anyref) $parent))
;; CHECK: (type $none_=>_none (func))
diff --git a/test/lit/passes/simplify-locals-gc.wast b/test/lit/passes/simplify-locals-gc.wast
index 0d22ecaaa..365373c83 100644
--- a/test/lit/passes/simplify-locals-gc.wast
+++ b/test/lit/passes/simplify-locals-gc.wast
@@ -6,7 +6,7 @@
(module
;; CHECK: (type $A (struct (field structref)))
- ;; CHECK: (type $B (struct_subtype (field (ref struct)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (ref struct)))))
;; CHECK: (type $struct (struct (field (mut i32))))
(type $struct (struct (field (mut i32))))
diff --git a/test/lit/passes/type-merging-tnh.wast b/test/lit/passes/type-merging-tnh.wast
index 0ec9ac38e..5321b9cce 100644
--- a/test/lit/passes/type-merging-tnh.wast
+++ b/test/lit/passes/type-merging-tnh.wast
@@ -27,7 +27,7 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $A (struct ))
(type $A (struct))
- ;; CHECK: (type $B (struct_subtype $A))
+ ;; CHECK: (type $B (sub $A (struct )))
(type $B (struct_subtype $A))
;; CHECK: (type $ref|$A|_=>_i32 (func (param (ref $A)) (result i32)))
@@ -49,7 +49,7 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $A (struct ))
(type $A (struct))
- ;; CHECK: (type $B (struct_subtype $A))
+ ;; CHECK: (type $B (sub $A (struct )))
(type $B (struct_subtype $A))
;; CHECK: (type $ref|$A|_=>_ref|$B| (func (param (ref $A)) (result (ref $B))))
diff --git a/test/lit/passes/type-merging.wast b/test/lit/passes/type-merging.wast
index 55ec42bd0..639810886 100644
--- a/test/lit/passes/type-merging.wast
+++ b/test/lit/passes/type-merging.wast
@@ -7,13 +7,13 @@
;; CHECK-NEXT: (type $A (struct (field anyref)))
(type $A (struct_subtype (field anyref) data))
(type $B (struct_subtype (field anyref) $A))
- ;; CHECK: (type $F (struct_subtype (field anyref) $A))
+ ;; CHECK: (type $F (sub $A (struct (field anyref))))
- ;; CHECK: (type $E (struct_subtype (field eqref) $A))
+ ;; CHECK: (type $E (sub $A (struct (field eqref))))
- ;; CHECK: (type $D (struct_subtype (field (ref any)) $A))
+ ;; CHECK: (type $D (sub $A (struct (field (ref any)))))
- ;; CHECK: (type $C (struct_subtype (field anyref) (field f64) $A))
+ ;; CHECK: (type $C (sub $A (struct (field anyref) (field f64))))
(type $C (struct_subtype (field anyref) (field f64) $A))
(type $D (struct_subtype (field (ref any)) $A))
(type $E (struct_subtype (field eqref) $A))
@@ -76,7 +76,7 @@
(type $A (struct_subtype (field i32) data))
(type $B (struct_subtype (field i32) $A))
(type $C (struct_subtype (field i32) $B))
- ;; CHECK: (type $D (struct_subtype (field i32) (field f64) $A))
+ ;; CHECK: (type $D (sub $A (struct (field i32) (field f64))))
(type $D (struct_subtype (field i32) (field f64) $A))
(type $E (struct_subtype (field i32) (field f64) $D))
(type $F (struct_subtype (field i32) (field f64) $E))
@@ -120,7 +120,7 @@
(type $A (struct_subtype (field i32) data))
(type $B (struct_subtype (field i32) $A))
(type $C (struct_subtype (field i32) $B))
- ;; CHECK: (type $D (struct_subtype (field i32) (field f64) $A))
+ ;; CHECK: (type $D (sub $A (struct (field i32) (field f64))))
(type $D (struct_subtype (field i32) (field f64) $C)) ;; this line changed
(type $E (struct_subtype (field i32) (field f64) $D))
(type $F (struct_subtype (field i32) (field f64) $E))
@@ -157,7 +157,7 @@
;; CHECK: (type $A (struct (field (ref null $X))))
(type $A (struct (field (ref null $X))))
(type $B (struct_subtype (field (ref null $Y)) $A))
- ;; CHECK: (type $C (struct_subtype (field (ref $X)) $A))
+ ;; CHECK: (type $C (sub $A (struct (field (ref $X)))))
(type $C (struct_subtype (field (ref $Y)) $A))
;; CHECK: (type $none_=>_none (func))
@@ -477,11 +477,11 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $X (struct (field anyref)))
(type $X (struct anyref))
- ;; CHECK: (type $Y (struct_subtype (field eqref) $X))
+ ;; CHECK: (type $Y (sub $X (struct (field eqref))))
(type $Y (struct_subtype eqref $X))
;; CHECK: (type $A (struct (field (ref null $X))))
(type $A (struct (ref null $X)))
- ;; CHECK: (type $B (struct_subtype (field (ref null $Y)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (ref null $Y)))))
(type $B (struct_subtype (ref null $Y) $A))
(type $C (struct_subtype (ref null $Y) $A))
@@ -508,7 +508,7 @@
;; CHECK-NEXT: (type $A (struct (field anyref)))
(type $A (struct anyref))
(type $B (struct_subtype eqref $A))
- ;; CHECK: (type $C (struct_subtype (field eqref) $A))
+ ;; CHECK: (type $C (sub $A (struct (field eqref))))
(type $C (struct_subtype eqref $A))
)
@@ -537,7 +537,7 @@
(type $B (struct_subtype anyref $A))
(type $C (struct_subtype anyref $A))
(type $D (struct_subtype eqref $B))
- ;; CHECK: (type $E (struct_subtype (field eqref) $A))
+ ;; CHECK: (type $E (sub $A (struct (field eqref))))
(type $E (struct_subtype eqref $C))
)
@@ -570,9 +570,9 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $B' (struct (field (ref $A))))
- ;; CHECK: (type $C (struct_subtype (field (ref $A)) (field i32) $B'))
+ ;; CHECK: (type $C (sub $B' (struct (field (ref $A)) (field i32))))
- ;; CHECK: (type $D' (struct_subtype (field (ref $A)) (field i32) (field i32) $C))
+ ;; CHECK: (type $D' (sub $C (struct (field (ref $A)) (field i32) (field i32))))
;; CHECK: (type $A (struct ))
(type $A (struct))
@@ -649,11 +649,11 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $C (struct (field (mut i32))))
- ;; CHECK: (type $D (struct_subtype (field (mut i32)) (field (mut i32)) $C))
+ ;; CHECK: (type $D (sub $C (struct (field (mut i32)) (field (mut i32)))))
- ;; CHECK: (type $H (struct_subtype (field (mut i32)) (field (mut i32)) (field (mut (ref null $D))) $D))
+ ;; CHECK: (type $H (sub $D (struct (field (mut i32)) (field (mut i32)) (field (mut (ref null $D))))))
- ;; CHECK: (type $A (struct_subtype (field (mut i32)) (field (mut i32)) (field (mut (ref null $D))) (field (mut i64)) (field (mut (ref null $I))) $H))
+ ;; CHECK: (type $A (sub $H (struct (field (mut i32)) (field (mut i32)) (field (mut (ref null $D))) (field (mut i64)) (field (mut (ref null $I))))))
;; CHECK: (type $I (array (mut (ref null $C))))
(type $I (array (mut (ref null $C))))
@@ -702,7 +702,7 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $refarray (array anyref))
- ;; CHECK: (type $sub-refarray-nn (array_subtype (ref any) $refarray))
+ ;; CHECK: (type $sub-refarray-nn (sub $refarray (array (ref any))))
;; CHECK: (type $intarray (array (mut i32)))
(type $intarray (array (mut i32)))
@@ -747,7 +747,7 @@
;; CHECK-NEXT: (type $func (func (param eqref)))
(type $func (func (param eqref)))
(type $sub-func (func_subtype (param eqref) $func))
- ;; CHECK: (type $sub-func-refined (func_subtype (param anyref) $func))
+ ;; CHECK: (type $sub-func-refined (sub $func (func (param anyref))))
(type $sub-func-refined (func_subtype (param anyref) $func))
;; CHECK: (type $none_=>_none (func))
@@ -772,7 +772,7 @@
(module
;; CHECK: (type $A (func))
(type $A (func)) ;; public
- ;; CHECK: (type $B (func_subtype $A))
+ ;; CHECK: (type $B (sub $A (func)))
(type $B (func_subtype $A)) ;; public
(type $C (func_subtype $B)) ;; private
@@ -868,11 +868,11 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $b (struct (field (ref null $x))))
- ;; CHECK: (type $b1 (struct_subtype (field (ref null $y)) $b))
+ ;; CHECK: (type $b1 (sub $b (struct (field (ref null $y)))))
;; CHECK: (type $x (struct (field anyref)))
(type $x (struct anyref))
- ;; CHECK: (type $y (struct_subtype (field anyref) $x))
+ ;; CHECK: (type $y (sub $x (struct (field anyref))))
(type $y (struct_subtype anyref $x))
;; If we did vertical and horizontal merges at the same time, these three
@@ -917,7 +917,7 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $A (struct ))
(type $A (struct))
- ;; CHECK: (type $B (struct_subtype $A))
+ ;; CHECK: (type $B (sub $A (struct )))
(type $B (struct_subtype $A))
;; CHECK: (type $ref|$A|_=>_i32 (func (param (ref $A)) (result i32)))
@@ -939,7 +939,7 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $A (struct ))
(type $A (struct))
- ;; CHECK: (type $B (struct_subtype $A))
+ ;; CHECK: (type $B (sub $A (struct )))
(type $B (struct_subtype $A))
;; CHECK: (type $ref|$A|_=>_ref|$B| (func (param (ref $A)) (result (ref $B))))
@@ -986,7 +986,7 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $A (func))
(type $A (func))
- ;; CHECK: (type $B (func_subtype $A))
+ ;; CHECK: (type $B (sub $A (func)))
(type $B (func_subtype $A))
(table 1 1 (ref null $A))
diff --git a/test/lit/passes/type-refining-isorecursive.wast b/test/lit/passes/type-refining-isorecursive.wast
index cf5de7979..a6e5b5976 100644
--- a/test/lit/passes/type-refining-isorecursive.wast
+++ b/test/lit/passes/type-refining-isorecursive.wast
@@ -66,9 +66,9 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $0 (struct (field (ref null $all)) (field (ref $0))))
- ;; CHECK: (type $1 (struct_subtype (field (ref null $all)) (field (ref $0)) $0))
+ ;; CHECK: (type $1 (sub $0 (struct (field (ref null $all)) (field (ref $0)))))
- ;; CHECK: (type $2 (struct_subtype (field (ref null $all)) (field (ref $0)) $1))
+ ;; CHECK: (type $2 (sub $1 (struct (field (ref null $all)) (field (ref $0)))))
;; CHECK: (type $all (struct (field i32) (field (ref $0)) (field (ref $1)) (field (ref $2))))
(type $all (struct_subtype i32 anyref anyref anyref data))
diff --git a/test/lit/passes/type-refining.wast b/test/lit/passes/type-refining.wast
index 824ad43a8..9c2241edd 100644
--- a/test/lit/passes/type-refining.wast
+++ b/test/lit/passes/type-refining.wast
@@ -93,9 +93,9 @@
;; CHECK-NEXT: (type $struct (struct (field (mut (ref $struct)))))
(type $struct (struct_subtype (field (mut structref)) data))
- ;; CHECK: (type $child-B (struct_subtype (field (mut (ref $struct))) $struct))
+ ;; CHECK: (type $child-B (sub $struct (struct (field (mut (ref $struct))))))
- ;; CHECK: (type $child-A (struct_subtype (field (mut (ref $struct))) $struct))
+ ;; CHECK: (type $child-A (sub $struct (struct (field (mut (ref $struct))))))
(type $child-A (struct_subtype (field (mut structref)) $struct))
(type $child-B (struct_subtype (field (mut structref)) $struct))
@@ -134,10 +134,10 @@
;; CHECK-NEXT: (type $struct (struct (field (mut (ref $child-A)))))
(type $struct (struct_subtype (field (mut structref)) data))
- ;; CHECK: (type $child-A (struct_subtype (field (mut (ref $child-A))) $struct))
+ ;; CHECK: (type $child-A (sub $struct (struct (field (mut (ref $child-A))))))
(type $child-A (struct_subtype (field (mut structref)) $struct))
- ;; CHECK: (type $child-B (struct_subtype (field (mut (ref $child-A))) $struct))
+ ;; CHECK: (type $child-B (sub $struct (struct (field (mut (ref $child-A))))))
(type $child-B (struct_subtype (field (mut structref)) $struct))
)
@@ -187,7 +187,7 @@
;; CHECK-NEXT: (type $struct (struct (field (mut (ref $struct)))))
(type $struct (struct_subtype (field (mut structref)) data))
- ;; CHECK: (type $child (struct_subtype (field (mut (ref $struct))) $struct))
+ ;; CHECK: (type $child (sub $struct (struct (field (mut (ref $struct))))))
(type $child (struct_subtype (field (mut structref)) $struct))
;; CHECK: (type $ref|$struct|_ref|$child|_=>_none (func (param (ref $struct) (ref $child))))
@@ -221,7 +221,7 @@
;; CHECK-NEXT: (type $struct (struct (field (mut (ref $child)))))
(type $struct (struct_subtype (field (mut structref)) data))
- ;; CHECK: (type $child (struct_subtype (field (mut (ref $child))) $struct))
+ ;; CHECK: (type $child (sub $struct (struct (field (mut (ref $child))))))
(type $child (struct_subtype (field (mut structref)) $struct))
;; CHECK: (type $ref|$struct|_ref|$child|_=>_none (func (param (ref $struct) (ref $child))))
@@ -258,7 +258,7 @@
;; CHECK-NEXT: (type $struct (struct (field (mut (ref $struct)))))
(type $struct (struct_subtype (field (mut structref)) data))
- ;; CHECK: (type $child (struct_subtype (field (mut (ref $struct))) $struct))
+ ;; CHECK: (type $child (sub $struct (struct (field (mut (ref $struct))))))
(type $child (struct_subtype (field (mut structref)) $struct))
;; CHECK: (type $ref|$struct|_ref|$child|_=>_none (func (param (ref $struct) (ref $child))))
@@ -303,7 +303,7 @@
;; CHECK-NEXT: (type $struct (struct (field (ref $struct))))
(type $struct (struct_subtype (field structref) data))
- ;; CHECK: (type $child (struct_subtype (field (ref $child)) $struct))
+ ;; CHECK: (type $child (sub $struct (struct (field (ref $child)))))
(type $child (struct_subtype (field structref) $struct))
;; CHECK: (type $ref|$struct|_ref|$child|_=>_none (func (param (ref $struct) (ref $child))))
@@ -343,7 +343,7 @@
;; CHECK-NEXT: (type $struct (struct (field (mut (ref $struct)))))
(type $struct (struct_subtype (field (mut structref)) data))
- ;; CHECK: (type $child (struct_subtype (field (mut (ref $struct))) $struct))
+ ;; CHECK: (type $child (sub $struct (struct (field (mut (ref $struct))))))
(type $child (struct_subtype (field (mut structref)) $struct))
;; CHECK: (type $ref|$struct|_ref|$child|_=>_none (func (param (ref $struct) (ref $child))))
@@ -383,7 +383,7 @@
;; CHECK-NEXT: (type $struct (struct (field (mut (ref $struct)))))
(type $struct (struct_subtype (field (mut structref)) data))
- ;; CHECK: (type $child (struct_subtype (field (mut (ref $struct))) (field (mut (ref $child))) $struct))
+ ;; CHECK: (type $child (sub $struct (struct (field (mut (ref $struct))) (field (mut (ref $child))))))
(type $child (struct_subtype (field (mut structref)) (field (mut structref)) $struct))
;; CHECK: (type $ref|$struct|_ref|$child|_=>_none (func (param (ref $struct) (ref $child))))
@@ -457,17 +457,17 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $A (struct (field (ref $Y))))
- ;; CHECK: (type $B (struct_subtype (field (ref $Y)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (ref $Y)))))
;; CHECK: (type $X (struct ))
(type $X (struct))
- ;; CHECK: (type $Y (struct_subtype $X))
+ ;; CHECK: (type $Y (sub $X (struct )))
(type $Y (struct_subtype $X))
(type $A (struct_subtype (field (ref $X)) data))
- ;; CHECK: (type $C (struct_subtype (field (ref $Y)) $A))
+ ;; CHECK: (type $C (sub $A (struct (field (ref $Y)))))
(type $C (struct_subtype (field (ref $X)) $A))
(type $B (struct_subtype (field (ref $X)) $A))
@@ -512,16 +512,16 @@
;; CHECK-NEXT: (type $X (struct ))
(type $X (struct))
- ;; CHECK: (type $Y (struct_subtype $X))
+ ;; CHECK: (type $Y (sub $X (struct )))
(type $Y (struct_subtype $X))
;; CHECK: (type $A (struct (field (ref $X))))
(type $A (struct_subtype (field (ref $X)) data))
- ;; CHECK: (type $B (struct_subtype (field (ref $X)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (ref $X)))))
(type $B (struct_subtype (field (ref $X)) $A))
- ;; CHECK: (type $C (struct_subtype (field (ref $X)) $A))
+ ;; CHECK: (type $C (sub $A (struct (field (ref $X)))))
(type $C (struct_subtype (field (ref $X)) $A))
)
@@ -549,12 +549,12 @@
;; CHECK: (type $A (struct (field (ref $X))))
- ;; CHECK: (type $Y (struct_subtype $X))
+ ;; CHECK: (type $Y (sub $X (struct )))
(type $Y (struct_subtype $X))
(type $A (struct_subtype (field (ref $X)) data))
- ;; CHECK: (type $B (struct_subtype (field (ref $Y)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (ref $Y)))))
(type $B (struct_subtype (field (ref $Y)) $A))
;; CHECK: (func $foo (type $none_=>_none)
@@ -618,7 +618,7 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $struct (struct (field (mut (ref null $struct)))))
(type $struct (struct_subtype (field (mut (ref null struct))) data))
- ;; CHECK: (type $child (struct_subtype (field (mut (ref null $struct))) $struct))
+ ;; CHECK: (type $child (sub $struct (struct (field (mut (ref null $struct))))))
(type $child (struct_subtype (field (mut (ref null struct))) $struct))
;; CHECK: (type $ref|$struct|_ref|$child|_=>_none (func (param (ref $struct) (ref $child))))
@@ -651,7 +651,7 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $struct (struct (field (mut (ref null $struct)))))
(type $struct (struct_subtype (field (mut (ref null struct))) data))
- ;; CHECK: (type $child (struct_subtype (field (mut (ref null $struct))) $struct))
+ ;; CHECK: (type $child (sub $struct (struct (field (mut (ref null $struct))))))
(type $child (struct_subtype (field (mut (ref null struct))) $struct))
;; CHECK: (type $ref|$struct|_ref|$child|_=>_none (func (param (ref $struct) (ref $child))))
@@ -766,7 +766,7 @@
;; CHECK-NEXT: (type $struct (struct (field (mut (ref null $child))) (field (mut (ref null $struct)))))
(type $struct (struct_subtype (field (mut (ref null struct))) (field (mut (ref null struct))) data))
- ;; CHECK: (type $child (struct_subtype (field (mut (ref null $child))) (field (mut (ref null $struct))) $struct))
+ ;; CHECK: (type $child (sub $struct (struct (field (mut (ref null $child))) (field (mut (ref null $struct))))))
(type $child (struct_subtype (field (mut (ref null struct))) (field (mut (ref null struct))) $struct))
;; CHECK: (type $ref|$struct|_ref|$child|_=>_none (func (param (ref $struct) (ref $child))))
@@ -822,16 +822,16 @@
;; CHECK-NEXT: (type $Root-Inner (struct ))
(type $Root-Inner (struct))
- ;; CHECK: (type $Leaf1-Inner (struct_subtype (field i32) $Root-Inner))
+ ;; CHECK: (type $Leaf1-Inner (sub $Root-Inner (struct (field i32))))
(type $Leaf1-Inner (struct_subtype (field i32) $Root-Inner))
;; CHECK: (type $Root-Outer (struct (field (ref $Leaf2-Inner))))
- ;; CHECK: (type $Leaf1-Outer (struct_subtype (field (ref $Leaf2-Inner)) $Root-Outer))
+ ;; CHECK: (type $Leaf1-Outer (sub $Root-Outer (struct (field (ref $Leaf2-Inner)))))
- ;; CHECK: (type $Leaf2-Outer (struct_subtype (field (ref $Leaf2-Inner)) $Root-Outer))
+ ;; CHECK: (type $Leaf2-Outer (sub $Root-Outer (struct (field (ref $Leaf2-Inner)))))
- ;; CHECK: (type $Leaf2-Inner (struct_subtype $Root-Inner))
+ ;; CHECK: (type $Leaf2-Inner (sub $Root-Inner (struct )))
(type $Leaf2-Inner (struct_subtype $Root-Inner))
(type $Root-Outer (struct_subtype (field (ref $Root-Inner)) data))
@@ -963,7 +963,7 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $A (struct (field (ref null $A))))
(type $A (struct_subtype (field (ref null $A)) data))
- ;; CHECK: (type $B (struct_subtype (field (ref null $B)) $A))
+ ;; CHECK: (type $B (sub $A (struct (field (ref null $B)))))
(type $B (struct_subtype (field (ref null $A)) $A))
;; CHECK: (type $ref?|$B|_ref?|$A|_=>_none (func (param (ref null $B) (ref null $A))))
diff --git a/test/lit/passes/type-ssa.wast b/test/lit/passes/type-ssa.wast
index cfea23999..1ed55ff7d 100644
--- a/test/lit/passes/type-ssa.wast
+++ b/test/lit/passes/type-ssa.wast
@@ -13,15 +13,15 @@
;; CHECK: (type $none_=>_none (func))
;; CHECK: (rec
- ;; CHECK-NEXT: (type $struct$1 (struct_subtype (field i32) $struct))
+ ;; CHECK-NEXT: (type $struct$1 (sub $struct (struct (field i32))))
- ;; CHECK: (type $struct$2 (struct_subtype (field i32) $struct))
+ ;; CHECK: (type $struct$2 (sub $struct (struct (field i32))))
- ;; CHECK: (type $struct$3 (struct_subtype (field i32) $struct))
+ ;; CHECK: (type $struct$3 (sub $struct (struct (field i32))))
- ;; CHECK: (type $struct$4 (struct_subtype (field i32) $struct))
+ ;; CHECK: (type $struct$4 (sub $struct (struct (field i32))))
- ;; CHECK: (type $struct$5 (struct_subtype (field i32) $struct))
+ ;; CHECK: (type $struct$5 (sub $struct (struct (field i32))))
;; CHECK: (global $g (ref $struct) (struct.new $struct$4
;; CHECK-NEXT: (i32.const 42)
@@ -83,11 +83,11 @@
(type $struct (struct_subtype (field (ref null any)) data))
;; CHECK: (rec
- ;; CHECK-NEXT: (type $struct$1 (struct_subtype (field anyref) $struct))
+ ;; CHECK-NEXT: (type $struct$1 (sub $struct (struct (field anyref))))
- ;; CHECK: (type $struct$2 (struct_subtype (field anyref) $struct))
+ ;; CHECK: (type $struct$2 (sub $struct (struct (field anyref))))
- ;; CHECK: (type $struct$3 (struct_subtype (field anyref) $struct))
+ ;; CHECK: (type $struct$3 (sub $struct (struct (field anyref))))
;; CHECK: (func $foo (type $anyref_arrayref_=>_none) (param $any anyref) (param $array arrayref)
;; CHECK-NEXT: (drop
@@ -160,17 +160,17 @@
(elem func $array.new)
;; CHECK: (rec
- ;; CHECK-NEXT: (type $array$1 (array_subtype (mut anyref) $array))
+ ;; CHECK-NEXT: (type $array$1 (sub $array (array (mut anyref))))
- ;; CHECK: (type $array$2 (array_subtype (mut anyref) $array))
+ ;; CHECK: (type $array$2 (sub $array (array (mut anyref))))
- ;; CHECK: (type $array$3 (array_subtype (mut anyref) $array))
+ ;; CHECK: (type $array$3 (sub $array (array (mut anyref))))
- ;; CHECK: (type $array-func$4 (array_subtype (mut funcref) $array-func))
+ ;; CHECK: (type $array-func$4 (sub $array-func (array (mut funcref))))
- ;; CHECK: (type $array$5 (array_subtype (mut anyref) $array))
+ ;; CHECK: (type $array$5 (sub $array (array (mut anyref))))
- ;; CHECK: (type $array$6 (array_subtype (mut anyref) $array))
+ ;; CHECK: (type $array$6 (sub $array (array (mut anyref))))
;; CHECK: (type $none_=>_none (func))
@@ -313,7 +313,7 @@
;; CHECK: (type $empty (struct ))
(type $empty (struct))
- ;; CHECK: (type $empty$1 (struct_subtype $empty))
+ ;; CHECK: (type $empty$1 (sub $empty (struct )))
;; CHECK: (type $anyref_=>_none (func (param anyref)))
@@ -366,13 +366,13 @@
;; CHECK: (type $array (array (mut f32)))
(type $array (array (mut f32)))
- ;; CHECK: (type $subarray (array_subtype (mut f32) $array))
+ ;; CHECK: (type $subarray (sub $array (array (mut f32))))
(type $subarray (array_subtype (mut f32) $array))
;; CHECK: (type $ref|$subarray|_=>_none (func (param (ref $subarray))))
;; CHECK: (rec
- ;; CHECK-NEXT: (type $array$1 (array_subtype (mut f32) $array))
+ ;; CHECK-NEXT: (type $array$1 (sub $array (array (mut f32))))
;; CHECK: (type ${mut:i32_mut:i32_mut:f64_mut:f64_mut:i32_mut:f64_mut:f64_mut:i32_mut:i32_mut:i32_mut:i32} (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))))
diff --git a/test/lit/recursive-types.wast b/test/lit/recursive-types.wast
index 883756f7a..fc3d83dc3 100644
--- a/test/lit/recursive-types.wast
+++ b/test/lit/recursive-types.wast
@@ -16,7 +16,7 @@
(type (func_subtype (param (ref null 3)) (result (ref null 4)) $f3))
)
- ;; CHECK: (type $type$2 (func_subtype (param (ref null $f3)) (result (ref null $type$2)) $f3))
+ ;; CHECK: (type $type$2 (sub $f3 (func (param (ref null $f3)) (result (ref null $type$2)))))
;; CHECK: (type $type$1 (func (param (ref null $type$0)) (result (ref null $type$0))))
diff --git a/test/lit/subtype-chain.wast b/test/lit/subtype-chain.wast
index 5c832ec80..77c63e27a 100644
--- a/test/lit/subtype-chain.wast
+++ b/test/lit/subtype-chain.wast
@@ -10,16 +10,16 @@
;; CHECK: (type $root (struct ))
(type $root (struct))
- ;; CHECK: (type $trunk (struct_subtype (field i32) $root))
+ ;; CHECK: (type $trunk (sub $root (struct (field i32))))
(type $trunk (struct_subtype i32 $root))
- ;; CHECK: (type $branch (struct_subtype (field i32) (field i64) $trunk))
+ ;; CHECK: (type $branch (sub $trunk (struct (field i32) (field i64))))
(type $branch (struct_subtype i32 i64 $trunk))
- ;; CHECK: (type $twig (struct_subtype (field i32) (field i64) (field f32) $branch))
+ ;; CHECK: (type $twig (sub $branch (struct (field i32) (field i64) (field f32))))
(type $twig (struct_subtype i32 i64 f32 $branch))
- ;; CHECK: (type $leaf (struct_subtype (field i32) (field i64) (field f32) (field f64) $twig))
+ ;; CHECK: (type $leaf (sub $twig (struct (field i32) (field i64) (field f32) (field f64))))
(type $leaf (struct_subtype i32 i64 f32 f64 $twig))
;; CHECK: (func $make-root (type $ref|$leaf|_=>_ref?|$root|) (param $leaf (ref $leaf)) (result (ref null $root))
diff --git a/test/lit/subtypes.wast b/test/lit/subtypes.wast
index 00ed88453..b691650ac 100644
--- a/test/lit/subtypes.wast
+++ b/test/lit/subtypes.wast
@@ -8,7 +8,7 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $super-struct (struct (field i32)))
(type $super-struct (struct i32))
- ;; CHECK: (type $sub-struct (struct_subtype (field i32) (field i64) $super-struct))
+ ;; CHECK: (type $sub-struct (sub $super-struct (struct (field i32) (field i64))))
(type $sub-struct (struct_subtype i32 i64 $super-struct))
)
@@ -16,7 +16,7 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $super-array (array (ref $super-struct)))
(type $super-array (array (ref $super-struct)))
- ;; CHECK: (type $sub-array (array_subtype (ref $sub-struct) $super-array))
+ ;; CHECK: (type $sub-array (sub $super-array (array (ref $sub-struct))))
(type $sub-array (array_subtype (ref $sub-struct) $super-array))
)
@@ -24,7 +24,7 @@
;; CHECK: (rec
;; CHECK-NEXT: (type $super-func (func (param (ref $sub-array)) (result (ref $super-array))))
(type $super-func (func (param (ref $sub-array)) (result (ref $super-array))))
- ;; CHECK: (type $sub-func (func_subtype (param (ref $super-array)) (result (ref $sub-array)) $super-func))
+ ;; CHECK: (type $sub-func (sub $super-func (func (param (ref $super-array)) (result (ref $sub-array)))))
(type $sub-func (func_subtype (param (ref $super-array)) (result (ref $sub-array)) $super-func))
)
diff --git a/test/lit/tail-call.wast b/test/lit/tail-call.wast
index a82313bfd..a2f96eeba 100644
--- a/test/lit/tail-call.wast
+++ b/test/lit/tail-call.wast
@@ -36,7 +36,7 @@
;; CHECK: (type $A (struct (field i32)))
(type $A (struct i32))
- ;; CHECK: (type $B (struct_subtype (field i32) (field i32) $A))
+ ;; CHECK: (type $B (sub $A (struct (field i32) (field i32))))
(type $B (struct_subtype i32 i32 $A))
;; CHECK: (type $return-B (func (result (ref $B))))
diff --git a/test/lit/wat-kitchen-sink.wast b/test/lit/wat-kitchen-sink.wast
index 1183b3fcc..6c280b1e4 100644
--- a/test/lit/wat-kitchen-sink.wast
+++ b/test/lit/wat-kitchen-sink.wast
@@ -140,13 +140,13 @@
(type $void (func))
)
- ;; CHECK: (type $subvoid (func_subtype $void))
+ ;; CHECK: (type $subvoid (sub $void (func)))
(type $subvoid (sub $void (func)))
(type $many (func (param $x i32) (param i64 f32) (param) (param $y f64)
(result anyref (ref func))))
- ;; CHECK: (type $submany (func_subtype (param i32 i64 f32 f64) (result anyref (ref func)) $many))
+ ;; CHECK: (type $submany (sub $many (func (param i32 i64 f32 f64) (result anyref (ref func)))))
(type $submany (sub $many (func (param i32 i64 f32 f64) (result anyref (ref func)))))
;; globals
diff --git a/test/passes/Oz_fuzz-exec_all-features.txt b/test/passes/Oz_fuzz-exec_all-features.txt
index 33760cae3..b1ca259a3 100644
--- a/test/passes/Oz_fuzz-exec_all-features.txt
+++ b/test/passes/Oz_fuzz-exec_all-features.txt
@@ -60,7 +60,7 @@
(type $void_func (func))
(type $struct (struct (field (mut i32))))
(type $i32_=>_none (func (param i32)))
- (type $extendedstruct (struct_subtype (field (mut i32)) (field f64) $struct))
+ (type $extendedstruct (sub $struct (struct (field (mut i32)) (field f64))))
(type $int_func (func (result i32)))
(import "fuzzing-support" "log-i32" (func $log (type $i32_=>_none) (param i32)))
(export "structs" (func $0))
diff --git a/test/subtypes.wast.from-wast b/test/subtypes.wast.from-wast
index f927ab7c6..29c40a302 100644
--- a/test/subtypes.wast.from-wast
+++ b/test/subtypes.wast.from-wast
@@ -1,15 +1,15 @@
(module
(type $struct-rec-one (struct (field (ref $struct-rec-one))))
- (type $struct-rec-two (struct_subtype (field (ref $struct-rec-two)) (field (ref $struct-rec-two)) $struct-rec-one))
+ (type $struct-rec-two (sub $struct-rec-one (struct (field (ref $struct-rec-two)) (field (ref $struct-rec-two)))))
(type $vector-i32 (array i32))
(type $struct-any (struct (field (ref any))))
- (type $struct-i31 (struct_subtype (field (ref i31)) $struct-any))
+ (type $struct-i31 (sub $struct-any (struct (field (ref i31)))))
(type $ref|$vector-i32|_ref?|$vector-i32|_=>_none (func (param (ref $vector-i32) (ref null $vector-i32))))
(type $vector-any (array (ref any)))
- (type $vector-i31 (array_subtype (ref i31) $vector-any))
+ (type $vector-i31 (sub $vector-any (array (ref i31))))
(type $ref|$vector-i31|_ref|$vector-any|_=>_none (func (param (ref $vector-i31) (ref $vector-any))))
(type $ref|$struct-i31|_ref|$struct-any|_=>_none (func (param (ref $struct-i31) (ref $struct-any))))
- (type $struct-i31_any (struct_subtype (field (ref i31)) (field (ref any)) $struct-i31))
+ (type $struct-i31_any (sub $struct-i31 (struct (field (ref i31)) (field (ref any)))))
(type $ref|$struct-i31|_ref|$struct-i31_any|_=>_none (func (param (ref $struct-i31) (ref $struct-i31_any))))
(type $ref|$struct-rec-one|_ref|$struct-rec-two|_=>_none (func (param (ref $struct-rec-one) (ref $struct-rec-two))))
(func $foo (type $ref|$vector-i32|_ref?|$vector-i32|_=>_none) (param $no-null (ref $vector-i32)) (param $yes-null (ref null $vector-i32))
diff --git a/test/subtypes.wast.fromBinary b/test/subtypes.wast.fromBinary
index c29ad10b0..916fb036a 100644
--- a/test/subtypes.wast.fromBinary
+++ b/test/subtypes.wast.fromBinary
@@ -1,15 +1,15 @@
(module
(type $struct-rec-one (struct (field (ref $struct-rec-one))))
- (type $struct-rec-two (struct_subtype (field (ref $struct-rec-two)) (field (ref $struct-rec-two)) $struct-rec-one))
+ (type $struct-rec-two (sub $struct-rec-one (struct (field (ref $struct-rec-two)) (field (ref $struct-rec-two)))))
(type $vector-i32 (array i32))
(type $struct-any (struct (field (ref any))))
- (type $struct-i31 (struct_subtype (field (ref i31)) $struct-any))
+ (type $struct-i31 (sub $struct-any (struct (field (ref i31)))))
(type $ref|$vector-i32|_ref?|$vector-i32|_=>_none (func (param (ref $vector-i32) (ref null $vector-i32))))
(type $vector-any (array (ref any)))
- (type $vector-i31 (array_subtype (ref i31) $vector-any))
+ (type $vector-i31 (sub $vector-any (array (ref i31))))
(type $ref|$vector-i31|_ref|$vector-any|_=>_none (func (param (ref $vector-i31) (ref $vector-any))))
(type $ref|$struct-i31|_ref|$struct-any|_=>_none (func (param (ref $struct-i31) (ref $struct-any))))
- (type $struct-i31_any (struct_subtype (field (ref i31)) (field (ref any)) $struct-i31))
+ (type $struct-i31_any (sub $struct-i31 (struct (field (ref i31)) (field (ref any)))))
(type $ref|$struct-i31|_ref|$struct-i31_any|_=>_none (func (param (ref $struct-i31) (ref $struct-i31_any))))
(type $ref|$struct-rec-one|_ref|$struct-rec-two|_=>_none (func (param (ref $struct-rec-one) (ref $struct-rec-two))))
(func $foo (type $ref|$vector-i32|_ref?|$vector-i32|_=>_none) (param $no-null (ref $vector-i32)) (param $yes-null (ref null $vector-i32))
diff --git a/test/subtypes.wast.fromBinary.noDebugInfo b/test/subtypes.wast.fromBinary.noDebugInfo
index 0e77deeed..30e1d7aa0 100644
--- a/test/subtypes.wast.fromBinary.noDebugInfo
+++ b/test/subtypes.wast.fromBinary.noDebugInfo
@@ -1,15 +1,15 @@
(module
(type ${ref|...0|} (struct (field (ref ${ref|...0|}))))
- (type ${ref|...0|_ref|...0|} (struct_subtype (field (ref ${ref|...0|_ref|...0|})) (field (ref ${ref|...0|_ref|...0|})) ${ref|...0|}))
+ (type ${ref|...0|_ref|...0|} (sub ${ref|...0|} (struct (field (ref ${ref|...0|_ref|...0|})) (field (ref ${ref|...0|_ref|...0|})))))
(type $[i32] (array i32))
(type ${ref|any|} (struct (field (ref any))))
- (type ${ref|i31|} (struct_subtype (field (ref i31)) ${ref|any|}))
+ (type ${ref|i31|} (sub ${ref|any|} (struct (field (ref i31)))))
(type $ref|[i32]|_ref?|[i32]|_=>_none (func (param (ref $[i32]) (ref null $[i32]))))
(type $[ref|any|] (array (ref any)))
- (type $[ref|i31|] (array_subtype (ref i31) $[ref|any|]))
+ (type $[ref|i31|] (sub $[ref|any|] (array (ref i31))))
(type $ref|[ref|i31|]|_ref|[ref|any|]|_=>_none (func (param (ref $[ref|i31|]) (ref $[ref|any|]))))
(type $ref|{ref|i31|}|_ref|{ref|any|}|_=>_none (func (param (ref ${ref|i31|}) (ref ${ref|any|}))))
- (type ${ref|i31|_ref|any|} (struct_subtype (field (ref i31)) (field (ref any)) ${ref|i31|}))
+ (type ${ref|i31|_ref|any|} (sub ${ref|i31|} (struct (field (ref i31)) (field (ref any)))))
(type $ref|{ref|i31|}|_ref|{ref|i31|_ref|any|}|_=>_none (func (param (ref ${ref|i31|}) (ref ${ref|i31|_ref|any|}))))
(type $ref|{ref|...0|}|_ref|{ref|...0|_ref|...0|}|_=>_none (func (param (ref ${ref|...0|}) (ref ${ref|...0|_ref|...0|}))))
(func $0 (type $ref|[i32]|_ref?|[i32]|_=>_none) (param $0 (ref $[i32])) (param $1 (ref null $[i32]))