diff options
56 files changed, 499 insertions, 717 deletions
diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp index 40bd6288d..7da6ae0a5 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -49,11 +49,9 @@ int unhex(char c) { namespace wasm { -static Name STRUCT("struct"), FIELD("field"), ARRAY("array"), - FUNC_SUBTYPE("func_subtype"), STRUCT_SUBTYPE("struct_subtype"), - ARRAY_SUBTYPE("array_subtype"), EXTENDS("extends"), REC("rec"), I8("i8"), - I16("i16"), DECLARE("declare"), ITEM("item"), OFFSET("offset"), SUB("sub"), - FINAL("final"); +static Name STRUCT("struct"), FIELD("field"), ARRAY("array"), REC("rec"), + I8("i8"), I16("i16"), DECLARE("declare"), ITEM("item"), OFFSET("offset"), + SUB("sub"), FINAL("final"); static Address getAddress(const Element* s) { return std::stoll(s->toString()); @@ -959,51 +957,17 @@ void SExpressionWasmBuilder::preParseHeapTypes(Element& module) { } else { if (kind == FUNC) { builder[index] = parseSignatureDef(def, 0); - } else if (kind == FUNC_SUBTYPE) { - builder[index].setOpen(); - builder[index] = parseSignatureDef(def, 1); - super = def[def.size() - 1]; - if (!super->dollared() && super->str() == FUNC) { - // OK; no supertype - super = nullptr; - } } else if (kind == STRUCT) { builder[index] = parseStructDef(def, index, 0); - } else if (kind == STRUCT_SUBTYPE) { - builder[index].setOpen(); - builder[index] = parseStructDef(def, index, 1); - super = def[def.size() - 1]; - if (!super->dollared() && super->str() == DATA) { - // OK; no supertype - super = nullptr; - } } else if (kind == ARRAY) { builder[index] = parseArrayDef(def); - } else if (kind == ARRAY_SUBTYPE) { - builder[index].setOpen(); - builder[index] = parseArrayDef(def); - super = def[def.size() - 1]; - if (!super->dollared() && super->str() == DATA) { - // OK; no supertype - super = nullptr; - } } else { throw ParseException("unknown heaptype kind", kind.line, kind.col); } } if (super) { - if (!super->dollared()) { - throw ParseException("unknown supertype", super->line, super->col); - } - } else if (elementStartsWith(elem[elem.size() - 1], EXTENDS)) { - // '(' 'extends' $supertype ')' - builder[index].setOpen(); - Element& extends = *elem[elem.size() - 1]; - super = extends[1]; - } - if (super) { auto it = typeIndices.find(super->toString()); - if (it == typeIndices.end()) { + if (!super->dollared() || it == typeIndices.end()) { throw ParseException("unknown supertype", super->line, super->col); } builder[index].subTypeOf(builder[it->second]); diff --git a/test/ctor-eval/gc-2.wast b/test/ctor-eval/gc-2.wast index 114254d3f..731f70468 100644 --- a/test/ctor-eval/gc-2.wast +++ b/test/ctor-eval/gc-2.wast @@ -1,5 +1,5 @@ (module - (type $struct (struct_subtype (field i32) data)) + (type $struct (sub (struct (field i32)))) (import "import" "import" (func $import (param anyref))) diff --git a/test/ctor-eval/gc.wast b/test/ctor-eval/gc.wast index 965f6f38a..46ce6b49a 100644 --- a/test/ctor-eval/gc.wast +++ b/test/ctor-eval/gc.wast @@ -1,5 +1,5 @@ (module - (type $struct (struct_subtype (field i32) data)) + (type $struct (sub (struct (field i32)))) (import "import" "import" (func $import (param anyref))) @@ -62,4 +62,3 @@ ) ) ) - diff --git a/test/gtest/possible-contents.cpp b/test/gtest/possible-contents.cpp index 1838ad3ab..6599407fa 100644 --- a/test/gtest/possible-contents.cpp +++ b/test/gtest/possible-contents.cpp @@ -895,10 +895,10 @@ TEST_F(PossibleContentsTest, TestOracleManyTypes) { // we'll just report that more than one is possible, a cone of data. auto wasm = parse(R"( (module - (type $A (struct_subtype (field i32) data)) - (type $B (struct_subtype (field i64) data)) - (type $C (struct_subtype (field f32) data)) - (type $D (struct_subtype (field f64) data)) + (type $A (sub (struct (field i32)))) + (type $B (sub (struct (field i64)))) + (type $C (sub (struct (field f32)))) + (type $D (sub (struct (field f64)))) (func $foo (result (ref any)) (select (result (ref any)) (select (result (ref any)) @@ -930,9 +930,9 @@ TEST_F(PossibleContentsTest, TestOracleNoFullCones) { // infinity). auto wasm = parse(R"( (module - (type $A (struct_subtype (field i32) data)) - (type $B (struct_subtype (field i32) $A)) - (type $C (struct_subtype (field i32) $B)) + (type $A (sub (struct (field i32)))) + (type $B (sub $A (struct (field i32)))) + (type $C (sub $B (struct (field i32)))) (func $foo (export "foo") ;; Note we must declare $C so that $B and $C have uses and are not ;; removed automatically from consideration. diff --git a/test/lit/isorecursive-output-ordering.wast b/test/lit/isorecursive-output-ordering.wast index 43bda9a21..54d991301 100644 --- a/test/lit/isorecursive-output-ordering.wast +++ b/test/lit/isorecursive-output-ordering.wast @@ -15,22 +15,22 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $unused-1 (sub (struct ))) - (type $unused-1 (struct_subtype data)) + (type $unused-1 (sub (struct))) ;; CHECK: (type $unused-2 (sub (struct ))) - (type $unused-2 (struct_subtype data)) + (type $unused-2 (sub (struct))) ;; CHECK: (type $unused-3 (sub (struct ))) - (type $unused-3 (struct_subtype data)) + (type $unused-3 (sub (struct))) ;; CHECK: (type $unused-4 (sub (struct ))) - (type $unused-4 (struct_subtype data)) + (type $unused-4 (sub (struct))) ;; CHECK: (type $used-a-lot (sub (struct ))) - (type $used-a-lot (struct_subtype data)) + (type $used-a-lot (sub (struct))) ;; CHECK: (type $unused-5 (sub (struct ))) - (type $unused-5 (struct_subtype data)) + (type $unused-5 (sub (struct))) ) (rec - (type $unused-6 (struct_subtype data)) - (type $used-a-bit (struct_subtype data)) + (type $unused-6 (sub (struct))) + (type $used-a-bit (sub (struct))) ) ;; CHECK: (func $use (type $8) (param $0 (ref $used-a-lot)) (param $1 (ref $used-a-lot)) (param $2 (ref $used-a-lot)) (param $3 (ref $used-a-lot)) (param $4 (ref $used-a-lot)) (param $5 (ref $used-a-lot)) (result (ref $used-a-bit) (ref $used-a-bit) (ref $used-a-bit) (ref $used-a-bit)) @@ -48,9 +48,9 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $leaf (sub (struct ))) - (type $leaf (struct_subtype data)) + (type $leaf (sub (struct))) ;; CHECK: (type $unused (sub (struct ))) - (type $unused (struct_subtype data)) + (type $unused (sub (struct))) ) (rec @@ -61,22 +61,22 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $twig (sub (struct ))) - (type $twig (struct_subtype data)) + (type $twig (sub (struct))) ;; CHECK: (type $used-a-bit (sub (struct (field (ref $leaf))))) - (type $used-a-bit (struct_subtype (ref $leaf) data)) + (type $used-a-bit (sub (struct (ref $leaf)))) ) (rec - (type $shrub (struct_subtype $leaf)) - (type $used-a-ton (struct_subtype data)) + (type $shrub (sub $leaf (struct))) + (type $used-a-ton (sub (struct))) ) (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $root (sub (struct ))) - (type $root (struct_subtype data)) + (type $root (sub (struct))) ;; CHECK: (type $used-a-lot (sub $twig (struct ))) - (type $used-a-lot (struct_subtype $twig)) + (type $used-a-lot (sub $twig (struct))) ) ;; CHECK: (func $use (type $8) (param $0 (ref $used-a-lot)) (param $1 (ref $used-a-lot)) (param $2 (ref $used-a-lot)) (param $3 (ref $used-a-lot)) (param $4 (ref $used-a-lot)) (param $5 (ref $used-a-lot)) (result (ref $used-a-bit) (ref $used-a-bit) (ref $used-a-bit)) @@ -100,7 +100,7 @@ (rec ;; CHECK: (type $contains-basic (sub (struct (field (ref any))))) - (type $contains-basic (struct_subtype (ref any) data)) + (type $contains-basic (sub (struct (ref any)))) ) ;; CHECK: (func $use (type $1) (param $0 (ref $contains-basic)) diff --git a/test/lit/isorecursive-singleton-group.wast b/test/lit/isorecursive-singleton-group.wast index 6462b0288..80fa346c7 100644 --- a/test/lit/isorecursive-singleton-group.wast +++ b/test/lit/isorecursive-singleton-group.wast @@ -11,7 +11,7 @@ (rec ;; CHECK: (type $singleton (sub (struct ))) - (type $singleton (struct_subtype data)) + (type $singleton (sub (struct))) ) ;; Use the type so it appears in the output. diff --git a/test/lit/isorecursive-whole-group.wast b/test/lit/isorecursive-whole-group.wast index 4900d0ad9..3978a610c 100644 --- a/test/lit/isorecursive-whole-group.wast +++ b/test/lit/isorecursive-whole-group.wast @@ -10,9 +10,9 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $used (sub (struct ))) - (type $used (struct_subtype data)) + (type $used (sub (struct))) ;; CHECK: (type $unused (sub (struct ))) - (type $unused (struct_subtype data)) + (type $unused (sub (struct))) ) ;; CHECK: (global $g (ref null $used) (ref.null none)) diff --git a/test/lit/parse-bad-nominal-types.wast b/test/lit/parse-bad-nominal-types.wast index e73e4e51b..72cecc800 100644 --- a/test/lit/parse-bad-nominal-types.wast +++ b/test/lit/parse-bad-nominal-types.wast @@ -2,62 +2,17 @@ ;; RUN: foreach %s %t not wasm-opt -all 2>&1 | filecheck %s -;; CHECK: [parse exception: unknown supertype (at 2:35)] +;; CHECK: [parse exception: unknown supertype (at 2:24)] (module - (type $bad-func (func) (extends $bad)) + (type $bad-func (sub $bad (func))) ) -;; CHECK: [parse exception: unknown supertype (at 2:39)] +;; CHECK: [parse exception: unknown supertype (at 2:26)] (module - (type $bad-struct (struct) (extends $bad)) + (type $bad-struct (sub $bad (struct))) ) -;; CHECK: [parse exception: unknown supertype (at 2:41)] +;; CHECK: [parse exception: unknown supertype (at 2:25)] (module - (type $bad-array (array i32) (extends $bad)) -) - -;; CHECK: [parse exception: unknown supertype (at 2:33)] -(module - (type $bad-func (func_subtype $bad)) -) - -;; CHECK: [parse exception: unknown supertype (at 2:37)] -(module - (type $bad-struct (struct_subtype $bad)) -) - -;; CHECK: [parse exception: unknown supertype (at 2:39)] -(module - (type $bad-array (array_subtype i32 $bad)) -) - -;; CHECK: [parse exception: unknown supertype (at 2:32)] -(module - (type $bad-func (func_subtype any)) -) - -;; CHECK: [parse exception: unknown supertype (at 2:36)] -(module - (type $bad-struct (struct_subtype any)) -) - -;; CHECK: [parse exception: unknown supertype (at 2:38)] -(module - (type $bad-array (array_subtype i32 any)) -) - -;; CHECK: [parse exception: unknown supertype (at 2:32)] -(module - (type $bad-func (func_subtype data)) -) - -;; CHECK: [parse exception: unknown supertype (at 2:36)] -(module - (type $bad-struct (struct_subtype func)) -) - -;; CHECK: [parse exception: unknown supertype (at 2:38)] -(module - (type $bad-array (array_subtype i32 func)) + (type $bad-array (sub $bad (array i32))) ) diff --git a/test/lit/parse-bad-supertype.wast b/test/lit/parse-bad-supertype.wast index cbb53c675..10e8589fa 100644 --- a/test/lit/parse-bad-supertype.wast +++ b/test/lit/parse-bad-supertype.wast @@ -4,6 +4,6 @@ ;; CHECK: Fatal: Invalid type: Heap type has an invalid supertype at type $sub (module - (type $super (struct_subtype i32 data)) - (type $sub (struct_subtype i64 $super)) + (type $super (sub (struct i32))) + (type $sub (sub $super (struct i64))) )
\ No newline at end of file diff --git a/test/lit/parse-nominal-types-extends.wast b/test/lit/parse-nominal-types-extends.wast deleted file mode 100644 index 5ce3ffa91..000000000 --- a/test/lit/parse-nominal-types-extends.wast +++ /dev/null @@ -1,66 +0,0 @@ -;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. - -;; Test that new-style nominal types are parsed correctly. - -;; RUN: foreach %s %t wasm-opt -all -S -o - | filecheck %s -;; RUN: foreach %s %t wasm-opt -all --roundtrip -S -o - | filecheck %s - -;; void function type -(module - ;; CHECK: (type $super (sub (func))) - (type $super (sub (func))) - - ;; CHECK: (type $sub (sub $super (func))) - (type $sub (func) (extends $super)) - - ;; CHECK: (global $g (ref null $sub) (ref.null nofunc)) - (global $g (ref null $sub) (ref.null nofunc)) -) - -;; function type with params and results -(module - ;; CHECK: (type $super (sub (func (param i32) (result i32)))) - (type $super (sub (func (param i32) (result i32)))) - - ;; 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)) - (global $g (ref null $sub) (ref.null nofunc)) -) - -;; empty struct type -(module - ;; CHECK: (type $super (sub (struct ))) - (type $super (sub (struct))) - - ;; CHECK: (type $sub (sub $super (struct ))) - (type $sub (struct) (extends $super)) - - ;; CHECK: (global $g (ref null $sub) (ref.null none)) - (global $g (ref null $sub) (ref.null none)) -) - -;; struct type with fields -(module - ;; CHECK: (type $super (sub (struct (field i32) (field i64)))) - (type $super (sub (struct (field i32) i64))) - - ;; 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)) - (global $g (ref null $sub) (ref.null none)) -) - -;; array type -(module - ;; CHECK: (type $super (sub (array i8))) - (type $super (sub (array i8))) - - ;; CHECK: (type $sub (sub $super (array i8))) - (type $sub (array i8) (extends $super)) - - ;; CHECK: (global $g (ref null $sub) (ref.null none)) - (global $g (ref null $sub) (ref.null none)) -) diff --git a/test/lit/parse-nominal-types.wast b/test/lit/parse-nominal-types.wast deleted file mode 100644 index 2b753303e..000000000 --- a/test/lit/parse-nominal-types.wast +++ /dev/null @@ -1,66 +0,0 @@ -;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. - -;; Test that new-style nominal types are parsed correctly. - -;; RUN: foreach %s %t wasm-opt -all -S -o - | filecheck %s -;; RUN: foreach %s %t wasm-opt -all --roundtrip -S -o - | filecheck %s - -;; void function type -(module - ;; CHECK: (type $super (sub (func))) - (type $super (func_subtype func)) - - ;; CHECK: (type $sub (sub $super (func))) - (type $sub (func_subtype $super)) - - ;; CHECK: (global $g (ref null $sub) (ref.null nofunc)) - (global $g (ref null $sub) (ref.null nofunc)) -) - -;; function type with params and results -(module - ;; CHECK: (type $super (sub (func (param i32) (result i32)))) - (type $super (func_subtype (param i32) (result i32) func)) - - ;; 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)) - (global $g (ref null $sub) (ref.null nofunc)) -) - -;; empty struct type -(module - ;; CHECK: (type $super (sub (struct ))) - (type $super (struct_subtype data)) - - ;; CHECK: (type $sub (sub $super (struct ))) - (type $sub (struct_subtype $super)) - - ;; CHECK: (global $g (ref null $sub) (ref.null none)) - (global $g (ref null $sub) (ref.null none)) -) - -;; struct type with fields -(module - ;; CHECK: (type $super (sub (struct (field i32) (field i64)))) - (type $super (struct_subtype (field i32) i64 data)) - - ;; 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)) - (global $g (ref null $sub) (ref.null none)) -) - -;; array type -(module - ;; CHECK: (type $super (sub (array i8))) - (type $super (array_subtype i8 data)) - - ;; CHECK: (type $sub (sub $super (array i8))) - (type $sub (array_subtype i8 $super)) - - ;; CHECK: (global $g (ref null $sub) (ref.null none)) - (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 274909605..0b2025e7b 100644 --- a/test/lit/passes/abstract-type-refining.wast +++ b/test/lit/passes/abstract-type-refining.wast @@ -22,18 +22,18 @@ ;; YESTNH: (type $B (sub (struct ))) ;; NO_TNH: (type $B (sub $A (struct ))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) ;; YESTNH: (type $C (sub $B (struct ))) ;; NO_TNH: (type $C (sub $B (struct ))) - (type $C (struct_subtype $B)) + (type $C (sub $B (struct))) ;; NO_TNH: (type $D (sub $C (struct ))) - (type $D (struct_subtype $C)) + (type $D (sub $C (struct))) ;; YESTNH: (type $E (sub $C (struct ))) ;; NO_TNH: (type $E (sub $D (struct ))) - (type $E (struct_subtype $D)) + (type $E (sub $D (struct))) ;; YESTNH: (type $4 (func (param anyref))) @@ -279,9 +279,9 @@ ;; NO_TNH: (type $2 (func (param anyref))) ;; NO_TNH: (type $B (sub $A (struct ))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) - (type $B1 (struct_subtype $A)) ;; this is a new type + (type $B1 (sub $A (struct))) ;; this is a new type ) ;; YESTNH: (global $global anyref (struct.new_default $B)) @@ -365,12 +365,12 @@ ;; NO_TNH-NEXT: (type $A (sub (struct ))) (type $A (sub (struct))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) ;; YESTNH: (rec ;; YESTNH-NEXT: (type $B1 (sub (struct ))) ;; NO_TNH: (type $B1 (sub $A (struct ))) - (type $B1 (struct_subtype $A)) ;; this is a new type + (type $B1 (sub $A (struct))) ;; this is a new type ) ;; YESTNH: (type $1 (func (param anyref))) @@ -453,12 +453,12 @@ (type $A (sub (struct))) ;; NO_TNH: (type $B (sub $A (struct ))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) ;; YESTNH: (rec ;; YESTNH-NEXT: (type $C (sub (struct ))) ;; NO_TNH: (type $C (sub $B (struct ))) - (type $C (struct_subtype $B)) + (type $C (sub $B (struct))) ;; YESTNH: (type $1 (func (param anyref))) @@ -539,11 +539,11 @@ (rec (type $A (sub (struct))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) - (type $C1 (struct_subtype $B)) + (type $C1 (sub $B (struct))) - (type $C2 (struct_subtype $B)) + (type $C2 (sub $B (struct))) ) ;; YESTNH: (rec @@ -828,16 +828,16 @@ (type $A (sub (struct))) ;; NO_TNH: (type $B (sub $A (struct ))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) ;; YESTNH: (rec ;; YESTNH-NEXT: (type $0 (func (param anyref))) ;; YESTNH: (type $C1 (sub (struct ))) ;; NO_TNH: (type $C1 (sub $B (struct ))) - (type $C1 (struct_subtype $B)) + (type $C1 (sub $B (struct))) - (type $C2 (struct_subtype $B)) + (type $C2 (sub $B (struct))) ) ;; YESTNH: (global $global anyref (struct.new_default $C1)) @@ -993,11 +993,11 @@ ;; YESTNH: (type $B (sub $A (func))) ;; NO_TNH: (type $B (sub $A (func))) - (type $B (func_subtype $A)) + (type $B (sub $A (func))) ;; YESTNH: (type $C (sub $B (func))) ;; NO_TNH: (type $C (sub $B (func))) - (type $C (func_subtype $B)) + (type $C (sub $B (func))) ;; YESTNH: (type $3 (func (param funcref))) @@ -1091,11 +1091,11 @@ ;; NO_TNH-NEXT: (type $1 (func (param funcref))) ;; NO_TNH: (type $B (sub $A (func))) - (type $B (func_subtype $A)) + (type $B (sub $A (func))) ;; YESTNH: (type $C (sub $B (func))) ;; NO_TNH: (type $C (sub $B (func))) - (type $C (func_subtype $B)) + (type $C (sub $B (func))) ;; YESTNH: (elem declare func $A $C) @@ -1207,11 +1207,11 @@ ;; YESTNH: (type $B (sub $A (array (mut i32)))) ;; NO_TNH: (type $B (sub $A (array (mut i32)))) - (type $B (array_subtype (mut i32) $A)) + (type $B (sub $A (array (mut i32)))) ;; YESTNH: (type $C (sub $B (array (mut i32)))) ;; NO_TNH: (type $C (sub $B (array (mut i32)))) - (type $C (array_subtype (mut i32) $B)) + (type $C (sub $B (array (mut i32)))) ;; YESTNH: (global $A (ref $A) (array.new $A ;; YESTNH-NEXT: (i32.const 10) diff --git a/test/lit/passes/cfp.wast b/test/lit/passes/cfp.wast index 4236a16c6..e3bd4b049 100644 --- a/test/lit/passes/cfp.wast +++ b/test/lit/passes/cfp.wast @@ -552,7 +552,7 @@ ;; CHECK: (type $struct (sub (struct (field i32)))) (type $struct (sub (struct i32))) ;; CHECK: (type $substruct (sub $struct (struct (field i32)))) - (type $substruct (struct_subtype i32 $struct)) + (type $substruct (sub $struct (struct i32))) ;; CHECK: (type $3 (func (param (ref null $substruct)))) @@ -599,7 +599,7 @@ ;; CHECK: (type $1 (func (param (ref null $struct)))) ;; CHECK: (type $substruct (sub $struct (struct (field (mut i32))))) - (type $substruct (struct_subtype (mut i32) $struct)) + (type $substruct (sub $struct (struct (mut i32)))) ;; CHECK: (type $3 (func (param (ref null $substruct)))) @@ -656,7 +656,7 @@ (type $struct (sub (struct i32))) ;; CHECK: (type $substruct (sub $struct (struct (field i32) (field f64)))) - (type $substruct (struct_subtype i32 f64 $struct)) + (type $substruct (sub $struct (struct i32 f64))) ;; CHECK: (type $3 (func (param (ref null $struct)))) @@ -705,7 +705,7 @@ ;; CHECK: (type $1 (func)) ;; CHECK: (type $substruct (sub $struct (struct (field i32) (field f64)))) - (type $substruct (struct_subtype i32 f64 $struct)) + (type $substruct (sub $struct (struct i32 f64))) ;; CHECK: (type $3 (func (param (ref null $struct)))) @@ -765,7 +765,7 @@ ;; CHECK: (type $1 (func)) ;; CHECK: (type $substruct (sub $struct (struct (field i32) (field f64)))) - (type $substruct (struct_subtype i32 f64 $struct)) + (type $substruct (sub $struct (struct i32 f64))) ;; CHECK: (type $3 (func (param (ref null $struct)))) @@ -821,7 +821,7 @@ (type $struct (sub (struct i32))) ;; CHECK: (type $substruct (sub $struct (struct (field i32) (field f64)))) - (type $substruct (struct_subtype i32 f64 $struct)) + (type $substruct (sub $struct (struct i32 f64))) ;; CHECK: (type $2 (func)) @@ -880,7 +880,7 @@ (type $struct (sub (struct (mut i32)))) ;; CHECK: (type $substruct (sub $struct (struct (field (mut i32)) (field f64)))) - (type $substruct (struct_subtype (mut i32) f64 $struct)) + (type $substruct (sub $struct (struct (mut i32) f64))) ;; CHECK: (type $2 (func (param (ref null $struct)))) @@ -943,10 +943,10 @@ (type $struct1 (sub (struct i32))) ;; CHECK: (type $struct2 (sub $struct1 (struct (field i32) (field f64)))) - (type $struct2 (struct_subtype i32 f64 $struct1)) + (type $struct2 (sub $struct1 (struct i32 f64))) ;; CHECK: (type $struct3 (sub $struct2 (struct (field i32) (field f64) (field anyref)))) - (type $struct3 (struct_subtype i32 f64 anyref $struct2)) + (type $struct3 (sub $struct2 (struct i32 f64 anyref))) ;; CHECK: (type $3 (func)) @@ -1078,10 +1078,10 @@ (type $struct1 (sub (struct i32 i32))) ;; CHECK: (type $struct2 (sub $struct1 (struct (field i32) (field i32) (field f64) (field f64)))) - (type $struct2 (struct_subtype i32 i32 f64 f64 $struct1)) + (type $struct2 (sub $struct1 (struct i32 i32 f64 f64))) ;; 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)) + (type $struct3 (sub $struct2 (struct i32 i32 f64 f64 anyref anyref))) ;; CHECK: (type $3 (func (param anyref))) @@ -1307,9 +1307,9 @@ ;; CHECK: (type $struct1 (sub (struct (field (mut i32))))) (type $struct1 (sub (struct (mut i32)))) ;; CHECK: (type $struct2 (sub $struct1 (struct (field (mut i32)) (field f64)))) - (type $struct2 (struct_subtype (mut i32) f64 $struct1)) + (type $struct2 (sub $struct1 (struct (mut i32) f64))) ;; CHECK: (type $struct3 (sub $struct2 (struct (field (mut i32)) (field f64) (field anyref)))) - (type $struct3 (struct_subtype (mut i32) f64 anyref $struct2)) + (type $struct3 (sub $struct2 (struct (mut i32) f64 anyref))) ;; CHECK: (type $3 (func)) @@ -1405,10 +1405,10 @@ (type $struct1 (sub (struct (mut i32)))) ;; CHECK: (type $struct2 (sub $struct1 (struct (field (mut i32)) (field f64)))) - (type $struct2 (struct_subtype (mut i32) f64 $struct1)) + (type $struct2 (sub $struct1 (struct (mut i32) f64))) ;; CHECK: (type $struct3 (sub $struct2 (struct (field (mut i32)) (field f64) (field anyref)))) - (type $struct3 (struct_subtype (mut i32) f64 anyref $struct2)) + (type $struct3 (sub $struct2 (struct (mut i32) f64 anyref))) ;; CHECK: (type $3 (func (param (ref null $struct2)))) @@ -1631,10 +1631,10 @@ (type $A (sub (struct (mut i32)))) ;; CHECK: (type $B (sub $A (struct (field (mut i32))))) - (type $B (struct_subtype (mut i32) $A)) + (type $B (sub $A (struct (mut i32)))) ;; CHECK: (type $C (sub $B (struct (field (mut i32))))) - (type $C (struct_subtype (mut i32) $B)) + (type $C (sub $B (struct (mut i32)))) ;; CHECK: (type $3 (func)) @@ -2229,7 +2229,7 @@ ;; CHECK-NEXT: (type $A (sub (struct (field (mut i32))))) (type $A (sub (struct (field (mut i32))))) ;; CHECK: (type $B (sub $A (struct (field (mut i32))))) - (type $B (struct_subtype (field (mut i32)) $A)) + (type $B (sub $A (struct (field (mut i32))))) ) ;; CHECK: (type $2 (func (param i32) (result i32))) diff --git a/test/lit/passes/coalesce-locals-gc.wast b/test/lit/passes/coalesce-locals-gc.wast index b9224f59e..3706dc61f 100644 --- a/test/lit/passes/coalesce-locals-gc.wast +++ b/test/lit/passes/coalesce-locals-gc.wast @@ -8,10 +8,10 @@ ;; CHECK: (type $array (array (mut i8))) (type $array (array (mut i8))) - (type $A (struct_subtype (field (ref null struct)) data)) + (type $A (sub (struct (field (ref null struct))))) ;; CHECK: (type $B (sub $A (struct (field (ref struct))))) - (type $B (struct_subtype (field (ref struct)) $A)) + (type $B (sub $A (struct (field (ref struct))))) ;; CHECK: (global $global (ref null $array) (ref.null none)) (global $global (ref null $array) (ref.null $array)) diff --git a/test/lit/passes/dae-gc-refine-params.wast b/test/lit/passes/dae-gc-refine-params.wast index 7a7a30954..2f55e4012 100644 --- a/test/lit/passes/dae-gc-refine-params.wast +++ b/test/lit/passes/dae-gc-refine-params.wast @@ -6,18 +6,18 @@ (type ${} (sub (struct))) ;; CHECK: (type ${i32} (sub ${} (struct (field i32)))) - (type ${i32} (struct_subtype (field i32) ${})) + (type ${i32} (sub ${} (struct (field i32)))) ;; CHECK: (type ${i32_i64} (sub ${i32} (struct (field i32) (field i64)))) ;; CHECK: (type ${i32_f32} (sub ${i32} (struct (field i32) (field f32)))) ;; CHECK: (type ${f64} (sub ${} (struct (field f64)))) - (type ${f64} (struct_subtype (field f64) ${})) + (type ${f64} (sub ${} (struct (field f64)))) - (type ${i32_i64} (struct_subtype (field i32) (field i64) ${i32})) + (type ${i32_i64} (sub ${i32} (struct (field i32) (field i64)))) - (type ${i32_f32} (struct_subtype (field i32) (field f32) ${i32})) + (type ${i32_f32} (sub ${i32} (struct (field i32) (field f32)))) ;; CHECK: (func $call-various-params-no (type $0) ;; CHECK-NEXT: (call $various-params-no diff --git a/test/lit/passes/dae-gc-refine-return.wast b/test/lit/passes/dae-gc-refine-return.wast index a071cfc93..595a562e8 100644 --- a/test/lit/passes/dae-gc-refine-return.wast +++ b/test/lit/passes/dae-gc-refine-return.wast @@ -9,13 +9,13 @@ (type $return_{} (func (result (ref ${})))) ;; CHECK: (type ${i32} (sub ${} (struct (field i32)))) - (type ${i32} (struct_subtype (field i32) ${})) + (type ${i32} (sub ${} (struct (field i32)))) ;; CHECK: (type ${i32_f32} (sub ${i32} (struct (field i32) (field f32)))) - (type ${i32_f32} (struct_subtype (field i32) (field f32) ${i32})) + (type ${i32_f32} (sub ${i32} (struct (field i32) (field f32)))) ;; CHECK: (type ${i32_i64} (sub ${i32} (struct (field i32) (field i64)))) - (type ${i32_i64} (struct_subtype (field i32) (field i64) ${i32})) + (type ${i32_i64} (sub ${i32} (struct (field i32) (field i64)))) (table 1 1 funcref) diff --git a/test/lit/passes/dae_tnh.wast b/test/lit/passes/dae_tnh.wast index a5b1f2f2a..33e6eb09b 100644 --- a/test/lit/passes/dae_tnh.wast +++ b/test/lit/passes/dae_tnh.wast @@ -6,7 +6,7 @@ ;; CHECK: (type $0 (func)) ;; CHECK: (type $struct (sub (struct (field i32)))) - (type $struct (struct_subtype (field i32) data)) + (type $struct (sub (struct (field i32)))) ;; CHECK: (type $2 (func (param (ref null $struct)))) diff --git a/test/lit/passes/gsi.wast b/test/lit/passes/gsi.wast index 00a2f6c60..70991f550 100644 --- a/test/lit/passes/gsi.wast +++ b/test/lit/passes/gsi.wast @@ -668,12 +668,12 @@ ;; A subtype is not optimizable, which prevents $struct from being optimized. (module ;; CHECK: (type $struct (sub (struct (field i32)))) - (type $struct (struct_subtype i32 data)) + (type $struct (sub (struct i32))) ;; CHECK: (type $1 (func (param (ref null $struct)))) ;; CHECK: (type $sub-struct (sub $struct (struct (field i32)))) - (type $sub-struct (struct_subtype i32 $struct)) + (type $sub-struct (sub $struct (struct i32))) ;; CHECK: (global $global1 (ref $struct) (struct.new $struct ;; CHECK-NEXT: (i32.const 42) @@ -719,10 +719,10 @@ ;; optimize. (module ;; CHECK: (type $super-struct (sub (struct (field i32)))) - (type $super-struct (struct_subtype i32 data)) + (type $super-struct (sub (struct i32))) ;; CHECK: (type $struct (sub $super-struct (struct (field i32)))) - (type $struct (struct_subtype i32 $super-struct)) + (type $struct (sub $super-struct (struct i32))) ;; CHECK: (type $2 (func (param (ref null $struct)))) @@ -777,10 +777,10 @@ ;; between their 2 values. (module ;; CHECK: (type $super-struct (sub (struct (field i32)))) - (type $super-struct (struct_subtype i32 data)) + (type $super-struct (sub (struct i32))) ;; CHECK: (type $struct (sub $super-struct (struct (field i32)))) - (type $struct (struct_subtype i32 $super-struct)) + (type $struct (sub $super-struct (struct i32))) ;; CHECK: (type $2 (func (param (ref null $struct) (ref null $super-struct)))) @@ -888,13 +888,13 @@ ;; supertype. (module ;; CHECK: (type $super-struct (sub (struct (field i32)))) - (type $super-struct (struct_subtype i32 data)) + (type $super-struct (sub (struct i32))) ;; CHECK: (type $struct1 (sub $super-struct (struct (field i32) (field f32)))) - (type $struct1 (struct_subtype i32 f32 $super-struct)) + (type $struct1 (sub $super-struct (struct i32 f32))) ;; CHECK: (type $struct2 (sub $super-struct (struct (field i32) (field f64)))) - (type $struct2 (struct_subtype i32 f64 $super-struct)) + (type $struct2 (sub $super-struct (struct i32 f64))) ;; CHECK: (type $3 (func (param (ref null $super-struct) (ref null $struct1) (ref null $struct2)))) @@ -981,13 +981,13 @@ ;; As above, but now the subtypes each have 2 values, and we can optimize. (module ;; CHECK: (type $super-struct (sub (struct (field i32)))) - (type $super-struct (struct_subtype i32 data)) + (type $super-struct (sub (struct i32))) ;; CHECK: (type $struct1 (sub $super-struct (struct (field i32) (field f32)))) - (type $struct1 (struct_subtype i32 f32 $super-struct)) + (type $struct1 (sub $super-struct (struct i32 f32))) ;; CHECK: (type $struct2 (sub $super-struct (struct (field i32) (field f64)))) - (type $struct2 (struct_subtype i32 f64 $super-struct)) + (type $struct2 (sub $super-struct (struct i32 f64))) ;; CHECK: (type $3 (func (param (ref null $super-struct) (ref null $struct1) (ref null $struct2)))) @@ -1229,13 +1229,13 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field i32)))) - (type $struct (struct_subtype i32 data)) + (type $struct (sub (struct i32))) ;; CHECK: (type $sub-struct1 (sub $struct (struct (field i32)))) - (type $sub-struct1 (struct_subtype i32 $struct)) + (type $sub-struct1 (sub $struct (struct i32))) ;; CHECK: (type $sub-struct2 (sub $struct (struct (field i32)))) - (type $sub-struct2 (struct_subtype i32 $struct)) + (type $sub-struct2 (sub $struct (struct i32))) ) ;; CHECK: (type $3 (func (param (ref null $struct)))) @@ -1283,13 +1283,13 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field i32)))) - (type $struct (struct_subtype i32 data)) + (type $struct (sub (struct i32))) ;; CHECK: (type $sub-struct1 (sub $struct (struct (field i32)))) - (type $sub-struct1 (struct_subtype i32 $struct)) + (type $sub-struct1 (sub $struct (struct i32))) ;; CHECK: (type $sub-struct2 (sub $struct (struct (field i32)))) - (type $sub-struct2 (struct_subtype i32 $struct)) + (type $sub-struct2 (sub $struct (struct i32))) ) ;; CHECK: (type $3 (func (param (ref null $struct)))) @@ -1340,13 +1340,13 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field i32)))) - (type $struct (struct_subtype i32 data)) + (type $struct (sub (struct i32))) ;; CHECK: (type $sub-struct1 (sub $struct (struct (field i32)))) - (type $sub-struct1 (struct_subtype i32 $struct)) + (type $sub-struct1 (sub $struct (struct i32))) ;; CHECK: (type $sub-struct2 (sub $struct (struct (field i32)))) - (type $sub-struct2 (struct_subtype i32 $struct)) + (type $sub-struct2 (sub $struct (struct i32))) ) ;; CHECK: (type $3 (func (param (ref null $struct)))) diff --git a/test/lit/passes/gsi_vacuum_precompute.wast b/test/lit/passes/gsi_vacuum_precompute.wast index 1cbf47032..8383d57ad 100644 --- a/test/lit/passes/gsi_vacuum_precompute.wast +++ b/test/lit/passes/gsi_vacuum_precompute.wast @@ -23,11 +23,11 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $vtable (sub (struct (field funcref)))) - (type $vtable (struct_subtype (field funcref) data)) + (type $vtable (sub (struct (field funcref)))) ;; CHECK: (type $itable1 (sub (struct (field (ref $vtable))))) - (type $itable1 (struct_subtype (field (ref $vtable)) data)) + (type $itable1 (sub (struct (field (ref $vtable))))) ;; CHECK: (type $itable2 (sub (struct (field (ref $vtable))))) - (type $itable2 (struct_subtype (field (ref $vtable)) data)) + (type $itable2 (sub (struct (field (ref $vtable))))) ) ;; Two $vtable instances are created, in separate enclosing objects. diff --git a/test/lit/passes/gto-mutability.wast b/test/lit/passes/gto-mutability.wast index 4be26c348..28fc1bc69 100644 --- a/test/lit/passes/gto-mutability.wast +++ b/test/lit/passes/gto-mutability.wast @@ -434,7 +434,7 @@ ;; CHECK: (type $super (sub (struct (field i32)))) (type $super (sub (struct (field (mut i32))))) ;; CHECK: (type $sub (sub $super (struct (field i32)))) - (type $sub (struct_subtype (field (mut i32)) $super)) + (type $sub (sub $super (struct (field (mut i32))))) ;; CHECK: (type $3 (func)) @@ -488,7 +488,7 @@ ;; CHECK: (type $super (sub (struct (field (mut i32))))) (type $super (sub (struct (field (mut i32))))) ;; CHECK: (type $sub (sub $super (struct (field (mut i32))))) - (type $sub (struct_subtype (field (mut i32)) $super)) + (type $sub (sub $super (struct (field (mut i32))))) ;; CHECK: (type $2 (func (param (ref $super)))) @@ -553,7 +553,7 @@ ;; CHECK: (type $super (sub (struct (field (mut i32))))) (type $super (sub (struct (field (mut i32))))) ;; CHECK: (type $sub (sub $super (struct (field (mut i32))))) - (type $sub (struct_subtype (field (mut i32)) $super)) + (type $sub (sub $super (struct (field (mut i32))))) ;; CHECK: (type $2 (func (param (ref $sub)))) diff --git a/test/lit/passes/gto-removals.wast b/test/lit/passes/gto-removals.wast index 34e29b71d..07bd3fa45 100644 --- a/test/lit/passes/gto-removals.wast +++ b/test/lit/passes/gto-removals.wast @@ -7,7 +7,7 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct ))) - (type $struct (struct_subtype (field (mut funcref)) data)) + (type $struct (sub (struct (field (mut funcref))))) ;; CHECK: (type $1 (func (param (ref $struct)))) @@ -23,7 +23,7 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct ))) - (type $struct (struct_subtype (field (mut funcref)) data)) + (type $struct (sub (struct (field (mut funcref))))) ;; CHECK: (type $1 (func (param (ref $struct)))) @@ -54,7 +54,7 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct ))) - (type $struct (struct_subtype (field (mut funcref)) data)) + (type $struct (sub (struct (field (mut funcref))))) ;; CHECK: (type $1 (func (param (ref $struct)))) @@ -78,7 +78,7 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct ))) - (type $struct (struct_subtype (field (mut funcref)) data)) + (type $struct (sub (struct (field (mut funcref))))) ;; CHECK: (type $1 (func (param (ref $struct)))) @@ -101,7 +101,7 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field funcref)))) - (type $struct (struct_subtype (field (mut funcref)) data)) + (type $struct (sub (struct (field (mut funcref))))) ;; CHECK: (type $1 (func (param (ref $struct)))) @@ -133,11 +133,11 @@ ;; CHECK: (type $1 (func (param (ref $imm-struct)))) ;; CHECK: (type $mut-struct (sub (struct (field $r i32) (field $rw (mut i32)) (field $r-2 i32) (field $rw-2 (mut i32))))) - (type $mut-struct (struct_subtype (field $r (mut i32)) (field $w (mut i32)) (field $rw (mut i32)) (field $r-2 (mut i32)) (field $w-2 (mut i32)) (field $rw-2 (mut i32)) data)) + (type $mut-struct (sub (struct (field $r (mut i32)) (field $w (mut i32)) (field $rw (mut i32)) (field $r-2 (mut i32)) (field $w-2 (mut i32)) (field $rw-2 (mut i32))))) ;; A similar struct but with all fields marked immutable, and the only ;; writes are from during creation (so all fields are at least writeable). - (type $imm-struct (struct_subtype (field $w i32) (field $rw i32) (field $w-2 i32) (field $rw-2 i32) data)) + (type $imm-struct (sub (struct (field $w i32) (field $rw i32) (field $w-2 i32) (field $rw-2 i32)))) ;; CHECK: (type $3 (func (param (ref $mut-struct)))) @@ -284,7 +284,7 @@ ;; CHECK-NEXT: (type $0 (func)) ;; CHECK: (type $vtable (sub (struct (field $v1 funcref) (field $v2 funcref)))) - (type $vtable (struct_subtype (field $v0 funcref) (field $v1 funcref) (field $v2 funcref) (field $v3 funcref) (field $v4 funcref) data)) + (type $vtable (sub (struct (field $v0 funcref) (field $v1 funcref) (field $v2 funcref) (field $v3 funcref) (field $v4 funcref)))) ;; CHECK: (global $vtable (ref $vtable) (struct.new $vtable ;; CHECK-NEXT: (ref.func $func-1) @@ -359,7 +359,7 @@ ;; CHECK-NEXT: (type $0 (func)) ;; CHECK: (type $vtable (sub (struct (field $v1 i64) (field $v2 f32)))) - (type $vtable (struct_subtype (field $v0 i32) (field $v1 i64) (field $v2 f32) (field $v3 f64) (field $v4 anyref) data)) + (type $vtable (sub (struct (field $v0 i32) (field $v1 i64) (field $v2 f32) (field $v3 f64) (field $v4 anyref)))) ;; CHECK: (global $vtable (ref $vtable) (struct.new $vtable ;; CHECK-NEXT: (i64.const 1) @@ -636,10 +636,10 @@ (module ;; CHECK: (rec ;; CHECK-NEXT: (type $parent (sub (struct (field i32) (field i64)))) - (type $parent (struct_subtype (field i32) (field i64) (field f32) (field f64) data)) + (type $parent (sub (struct (field i32) (field i64) (field f32) (field f64)))) ;; 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)) + (type $child (sub $parent (struct (field i32) (field i64) (field f32) (field f64) (field anyref)))) ;; CHECK: (type $2 (func (param (ref $parent) (ref $child)))) @@ -686,10 +686,10 @@ (module ;; CHECK: (rec ;; CHECK-NEXT: (type $parent (sub (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)) + (type $parent (sub (struct (field (mut i32)) (field (mut i64)) (field (mut f32)) (field (mut f64))))) ;; 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)) + (type $child (sub $parent (struct (field (mut i32)) (field (mut i64)) (field (mut f32)) (field (mut f64)) (field (mut anyref))))) ;; CHECK: (type $2 (func (param (ref $parent) (ref $child)))) @@ -744,11 +744,11 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $parent (sub (struct (field i32)))) - (type $parent (struct_subtype (field i32) data)) + (type $parent (sub (struct (field i32)))) ;; CHECK: (type $child1 (sub $parent (struct (field i32)))) - (type $child1 (struct_subtype (field i32) $parent)) + (type $child1 (sub $parent (struct (field i32)))) ;; CHECK: (type $child2 (sub $parent (struct (field i32)))) - (type $child2 (struct_subtype (field i32) $parent)) + (type $child2 (sub $parent (struct (field i32)))) ) ;; CHECK: (type $3 (func (param (ref $parent) (ref $child1) (ref $child2)))) @@ -771,13 +771,13 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $parent (sub (struct ))) - (type $parent (struct_subtype (field i32) data)) + (type $parent (sub (struct (field i32)))) ;; CHECK: (type $child2 (sub $parent (struct ))) ;; CHECK: (type $child1 (sub $parent (struct (field i32)))) - (type $child1 (struct_subtype (field i32) $parent)) - (type $child2 (struct_subtype (field i32) $parent)) + (type $child1 (sub $parent (struct (field i32)))) + (type $child2 (sub $parent (struct (field i32)))) ) ;; CHECK: (type $3 (func (param (ref $parent) (ref $child1) (ref $child2)))) @@ -803,7 +803,7 @@ ;; CHECK: (type $2 (func)) ;; CHECK: (type ${mut:i8} (sub (struct ))) - (type ${mut:i8} (struct_subtype (field (mut i8)) data)) + (type ${mut:i8} (sub (struct (field (mut i8))))) ;; CHECK: (type $4 (func (param (ref null ${mut:i8})))) diff --git a/test/lit/passes/gto_and_cfp_in_O.wast b/test/lit/passes/gto_and_cfp_in_O.wast index ae0b11ee2..a723038eb 100644 --- a/test/lit/passes/gto_and_cfp_in_O.wast +++ b/test/lit/passes/gto_and_cfp_in_O.wast @@ -9,7 +9,7 @@ (module ;; OPEN_WORLD: (type $struct (sub (struct (field (mut funcref)) (field (mut i32))))) - (type $struct (struct_subtype (field (mut funcref)) (field (mut i32)) data)) + (type $struct (sub (struct (field (mut funcref)) (field (mut i32))))) ;; OPEN_WORLD: (type $1 (func)) diff --git a/test/lit/passes/gufa-refs.wast b/test/lit/passes/gufa-refs.wast index ee125b1f2..fa4afd6e0 100644 --- a/test/lit/passes/gufa-refs.wast +++ b/test/lit/passes/gufa-refs.wast @@ -924,12 +924,12 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct ))) - (type $struct (struct_subtype data)) + (type $struct (sub (struct))) ;; CHECK: (type $parent (sub (struct (field (mut (ref null $struct)))))) - (type $parent (struct_subtype (field (mut (ref null $struct))) data)) + (type $parent (sub (struct (field (mut (ref null $struct)))))) ;; 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)) + (type $child (sub $parent (struct (field (mut (ref null $struct))) (field (mut (ref null $struct)))))) ;; CHECK: (type $unrelated (struct )) (type $unrelated (struct)) @@ -1166,9 +1166,9 @@ ;; Default values in struct fields. (module (rec - (type $A (struct_subtype (field i32) data)) - (type $B (struct_subtype (field i32) data)) - (type $C (struct_subtype (field i32) data)) + (type $A (sub (struct (field i32)))) + (type $B (sub (struct (field i32)))) + (type $C (sub (struct (field i32)))) ) ;; CHECK: (type $0 (func)) @@ -1202,11 +1202,11 @@ ;; Exact types: Writes to the parent class do not confuse us. (module ;; CHECK: (type $struct (sub (struct ))) - (type $struct (struct_subtype data)) + (type $struct (sub (struct))) ;; CHECK: (type $parent (sub (struct (field (mut (ref null $struct)))))) - (type $parent (struct_subtype (field (mut (ref null $struct))) data)) + (type $parent (sub (struct (field (mut (ref null $struct)))))) ;; 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)) + (type $child (sub $parent (struct (field (mut (ref null $struct))) (field i32)))) ;; CHECK: (type $3 (func)) @@ -1286,9 +1286,9 @@ ;; Write values to the parent *and* the child and read from the child. (module ;; CHECK: (type $parent (sub (struct (field (mut i32))))) - (type $parent (struct_subtype (field (mut i32)) data)) + (type $parent (sub (struct (field (mut i32))))) ;; CHECK: (type $child (sub $parent (struct (field (mut i32)) (field i32)))) - (type $child (struct_subtype (field (mut i32)) (field i32) $parent)) + (type $child (sub $parent (struct (field (mut i32)) (field i32)))) ;; CHECK: (type $2 (func)) @@ -1378,9 +1378,9 @@ ;; As above, but the $parent local can now contain a child too. (module ;; CHECK: (type $parent (sub (struct (field (mut i32))))) - (type $parent (struct_subtype (field (mut i32)) data)) + (type $parent (sub (struct (field (mut i32))))) ;; CHECK: (type $child (sub $parent (struct (field (mut i32)) (field i32)))) - (type $child (struct_subtype (field (mut i32)) (field i32) $parent)) + (type $child (sub $parent (struct (field (mut i32)) (field i32)))) ;; CHECK: (type $2 (func (param i32))) @@ -1461,9 +1461,9 @@ ;; As above, but now the parent and child happen to agree on the aliased value. (module ;; CHECK: (type $parent (sub (struct (field (mut i32))))) - (type $parent (struct_subtype (field (mut i32)) data)) + (type $parent (sub (struct (field (mut i32))))) ;; CHECK: (type $child (sub $parent (struct (field (mut i32)) (field i32)))) - (type $child (struct_subtype (field (mut i32)) (field i32) $parent)) + (type $child (sub $parent (struct (field (mut i32)) (field i32)))) ;; CHECK: (type $2 (func)) @@ -1539,16 +1539,16 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $nothing (sub (array (mut anyref)))) - (type $nothing (array_subtype (mut (ref null any)) data)) + (type $nothing (sub (array (mut (ref null any))))) ;; CHECK: (type $null (sub (array (mut anyref)))) - (type $null (array_subtype (mut (ref null any)) data)) + (type $null (sub (array (mut (ref null any))))) ;; CHECK: (type $something (sub (array (mut anyref)))) - (type $something (array_subtype (mut (ref null any)) data)) + (type $something (sub (array (mut (ref null any))))) ;; CHECK: (type $something-child (sub $something (array (mut anyref)))) - (type $something-child (array_subtype (mut (ref null any)) $something)) + (type $something-child (sub $something (array (mut (ref null any))))) ) ;; CHECK: (type $4 (func)) @@ -2204,7 +2204,7 @@ (module ;; CHECK: (type ${} (sub (struct ))) - (type ${} (struct_subtype data)) + (type ${} (sub (struct))) ;; CHECK: (type $1 (func (result (ref ${})))) @@ -2240,13 +2240,13 @@ ;; CHECK: (type $0 (func)) ;; CHECK: (type $A (sub (struct (field i32)))) - (type $A (struct_subtype (field i32) data)) + (type $A (sub (struct (field i32)))) ;; CHECK: (type $B (sub (struct (field i64)))) - (type $B (struct_subtype (field i64) data)) + (type $B (sub (struct (field i64)))) ;; CHECK: (type $C (sub (struct (field f32)))) - (type $C (struct_subtype (field f32) data)) + (type $C (sub (struct (field f32)))) ;; CHECK: (type $D (sub (struct (field f64)))) - (type $D (struct_subtype (field f64) data)) + (type $D (sub (struct (field f64)))) ;; CHECK: (func $many-types (type $0) ;; CHECK-NEXT: (local $x anyref) @@ -2313,7 +2313,7 @@ ;; init) and a function ($create). (module ;; CHECK: (type $vtable-A (sub (struct (field funcref) (field funcref) (field funcref)))) - (type $vtable-A (struct_subtype (field (ref null func)) (field (ref null func)) (field (ref null func)) data)) + (type $vtable-A (sub (struct (field (ref null func)) (field (ref null func)) (field (ref null func))))) ;; CHECK: (type $1 (func)) @@ -2396,7 +2396,7 @@ (module ;; CHECK: (type $struct (sub (struct (field i32)))) - (type $struct (struct_subtype (field i32) data)) + (type $struct (sub (struct (field i32)))) ;; CHECK: (type $1 (func)) @@ -2447,18 +2447,18 @@ ;; Casts. (module ;; CHECK: (type $struct (sub (struct (field i32)))) - (type $struct (struct_subtype (field i32) data)) + (type $struct (sub (struct (field i32)))) ;; CHECK: (type $substruct (sub $struct (struct (field i32) (field i32)))) - (type $substruct (struct_subtype (field i32) (field i32) $struct)) + (type $substruct (sub $struct (struct (field i32) (field i32)))) ;; CHECK: (type $2 (func)) ;; CHECK: (type $subsubstruct (sub $substruct (struct (field i32) (field i32) (field i32)))) - (type $subsubstruct (struct_subtype (field i32) (field i32) (field i32) $substruct)) + (type $subsubstruct (sub $substruct (struct (field i32) (field i32) (field i32)))) ;; CHECK: (type $4 (func (param i32))) ;; CHECK: (type $other (sub (struct ))) - (type $other (struct_subtype data)) + (type $other (sub (struct))) ;; CHECK: (type $6 (func (result i32))) @@ -3348,8 +3348,8 @@ ;; Test ref.eq on globals. (module ;; CHECK: (type $A (sub (struct (field i32)))) - (type $A (struct_subtype (field i32) data)) - (type $B (struct_subtype (field i32) $A)) + (type $A (sub (struct (field i32)))) + (type $B (sub $A (struct (field i32)))) ;; CHECK: (type $1 (func)) @@ -3478,9 +3478,9 @@ ) (module - (type $A (struct_subtype (field i32) data)) - (type $B (struct_subtype (ref $A) data)) - (type $C (struct_subtype (ref $B) data)) + (type $A (sub (struct (field i32)))) + (type $B (sub (struct (ref $A)))) + (type $C (sub (struct (ref $B)))) ;; CHECK: (type $0 (func)) @@ -3512,11 +3512,11 @@ (module ;; CHECK: (type $A (sub (struct (field i32)))) - (type $A (struct_subtype (field i32) data)) + (type $A (sub (struct (field i32)))) ;; CHECK: (type $B (sub (struct (field (ref $A))))) - (type $B (struct_subtype (ref $A) data)) + (type $B (sub (struct (ref $A)))) ;; CHECK: (type $C (sub (struct (field (ref $B))))) - (type $C (struct_subtype (ref $B) data)) + (type $C (sub (struct (ref $B)))) ;; CHECK: (type $3 (func (result i32))) @@ -3565,9 +3565,9 @@ ;; ref.as* test. (module ;; CHECK: (type $A (sub (struct (field i32)))) - (type $A (struct_subtype (field i32) data)) + (type $A (sub (struct (field i32)))) ;; CHECK: (type $B (sub $A (struct (field i32) (field f64)))) - (type $B (struct_subtype (field i32) (field f64) $A)) + (type $B (sub $A (struct (field i32) (field f64)))) ;; CHECK: (type $2 (func (result i32))) @@ -3611,11 +3611,11 @@ (module ;; CHECK: (type $A (sub (struct (field i32)))) - (type $A (struct_subtype (field i32) data)) + (type $A (sub (struct (field i32)))) ;; CHECK: (type $1 (func (result i32))) ;; CHECK: (type $B (sub $A (struct (field i32) (field i32)))) - (type $B (struct_subtype (field i32) (field i32) $A)) + (type $B (sub $A (struct (field i32) (field i32)))) ;; CHECK: (func $0 (type $1) (result i32) ;; CHECK-NEXT: (local $ref (ref null $A)) ;; CHECK-NEXT: (local.set $ref @@ -3838,7 +3838,7 @@ ;; they might appear as if no content were possible there, and we'd emit an ;; unreachable. That should not happen anywhere here. (module - (type $A (struct_subtype data)) + (type $A (sub (struct))) ;; CHECK: (type $0 (func)) @@ -4224,10 +4224,10 @@ (module ;; CHECK: (type $struct (sub (struct (field (mut i32))))) - (type $struct (struct_subtype (mut i32) data)) + (type $struct (sub (struct (mut i32)))) ;; CHECK: (type $substruct (sub $struct (struct (field (mut i32)) (field f64)))) - (type $substruct (struct_subtype (mut i32) f64 $struct)) + (type $substruct (sub $struct (struct (mut i32) f64))) ;; CHECK: (type $2 (func)) @@ -4300,10 +4300,10 @@ ;; global $something. (module ;; CHECK: (type $struct (sub (struct (field (mut i32))))) - (type $struct (struct_subtype (mut i32) data)) + (type $struct (sub (struct (mut i32)))) ;; CHECK: (type $substruct (sub $struct (struct (field (mut i32)) (field f64)))) - (type $substruct (struct_subtype (mut i32) f64 $struct)) + (type $substruct (sub $struct (struct (mut i32) f64))) ;; CHECK: (type $2 (func)) @@ -4378,10 +4378,10 @@ ;; we can optimize. (module ;; CHECK: (type $struct (sub (struct (field (mut i32))))) - (type $struct (struct_subtype (mut i32) data)) + (type $struct (sub (struct (mut i32)))) ;; CHECK: (type $substruct (sub $struct (struct (field (mut i32)) (field f64)))) - (type $substruct (struct_subtype (mut i32) f64 $struct)) + (type $substruct (sub $struct (struct (mut i32) f64))) ;; CHECK: (type $2 (func)) @@ -4586,11 +4586,11 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct (field (mut i32))))) - (type $A (struct_subtype (field (mut i32)) data)) + (type $A (sub (struct (field (mut i32))))) ;; CHECK: (type $B (sub $A (struct (field (mut i32))))) - (type $B (struct_subtype (field (mut i32)) $A)) + (type $B (sub $A (struct (field (mut i32))))) ;; CHECK: (type $C (sub $B (struct (field (mut i32))))) - (type $C (struct_subtype (field (mut i32)) $B)) + (type $C (sub $B (struct (field (mut i32))))) ) ;; CHECK: (type $3 (func (param i32))) @@ -4694,11 +4694,11 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct (field (mut i32))))) - (type $A (struct_subtype (field (mut i32)) data)) + (type $A (sub (struct (field (mut i32))))) ;; CHECK: (type $B (sub $A (struct (field (mut i32))))) - (type $B (struct_subtype (field (mut i32)) $A)) + (type $B (sub $A (struct (field (mut i32))))) ;; CHECK: (type $C (sub $B (struct (field (mut i32))))) - (type $C (struct_subtype (field (mut i32)) $B)) + (type $C (sub $B (struct (field (mut i32))))) ) ;; CHECK: (type $3 (func (param i32))) @@ -4802,11 +4802,11 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct (field (mut i32))))) - (type $A (struct_subtype (field (mut i32)) data)) + (type $A (sub (struct (field (mut i32))))) ;; CHECK: (type $B (sub $A (struct (field (mut i32))))) - (type $B (struct_subtype (field (mut i32)) $A)) + (type $B (sub $A (struct (field (mut i32))))) ;; CHECK: (type $C (sub $A (struct (field (mut i32))))) - (type $C (struct_subtype (field (mut i32)) $A)) ;; This line changed. + (type $C (sub $A (struct (field (mut i32))))) ;; This line changed. ) ;; CHECK: (type $3 (func (param i32))) @@ -4916,11 +4916,11 @@ ;; Cone writes. (module ;; CHECK: (type $A (sub (struct (field (mut i32))))) - (type $A (struct_subtype (field (mut i32)) data)) + (type $A (sub (struct (field (mut i32))))) ;; CHECK: (type $B (sub $A (struct (field (mut i32))))) - (type $B (struct_subtype (field (mut i32)) $A)) + (type $B (sub $A (struct (field (mut i32))))) ;; CHECK: (type $C (sub $B (struct (field (mut i32))))) - (type $C (struct_subtype (field (mut i32)) $B)) + (type $C (sub $B (struct (field (mut i32))))) ;; CHECK: (type $3 (func (param i32))) @@ -5014,11 +5014,11 @@ ;; As above, but write a different value. (module ;; CHECK: (type $A (sub (struct (field (mut i32))))) - (type $A (struct_subtype (field (mut i32)) data)) + (type $A (sub (struct (field (mut i32))))) ;; CHECK: (type $B (sub $A (struct (field (mut i32))))) - (type $B (struct_subtype (field (mut i32)) $A)) + (type $B (sub $A (struct (field (mut i32))))) ;; CHECK: (type $C (sub $B (struct (field (mut i32))))) - (type $C (struct_subtype (field (mut i32)) $B)) + (type $C (sub $B (struct (field (mut i32))))) ;; CHECK: (type $3 (func (param i32))) @@ -5113,11 +5113,11 @@ ;; As above, but write a different cone. (module ;; CHECK: (type $A (sub (struct (field (mut i32))))) - (type $A (struct_subtype (field (mut i32)) data)) + (type $A (sub (struct (field (mut i32))))) ;; CHECK: (type $B (sub $A (struct (field (mut i32))))) - (type $B (struct_subtype (field (mut i32)) $A)) + (type $B (sub $A (struct (field (mut i32))))) ;; CHECK: (type $C (sub $B (struct (field (mut i32))))) - (type $C (struct_subtype (field (mut i32)) $B)) + (type $C (sub $B (struct (field (mut i32))))) ;; CHECK: (type $3 (func (param i32))) @@ -5213,10 +5213,10 @@ ;; at least. (module ;; CHECK: (type $A (sub (struct (field (mut i32))))) - (type $A (struct_subtype (field (mut i32)) data)) + (type $A (sub (struct (field (mut i32))))) ;; CHECK: (type $B (sub $A (struct (field (mut i32))))) - (type $B (struct_subtype (field (mut i32)) $A)) + (type $B (sub $A (struct (field (mut i32))))) ;; CHECK: (type $2 (func (param (ref $A)))) diff --git a/test/lit/passes/gufa-vs-cfp.wast b/test/lit/passes/gufa-vs-cfp.wast index 3ed490628..eb365c5d1 100644 --- a/test/lit/passes/gufa-vs-cfp.wast +++ b/test/lit/passes/gufa-vs-cfp.wast @@ -498,7 +498,7 @@ (module ;; CHECK: (type $struct (sub (struct (field i32)))) (type $struct (sub (struct i32))) - (type $substruct (struct_subtype i32 $struct)) + (type $substruct (sub $struct (struct i32))) ;; CHECK: (type $1 (func (result (ref $struct)))) @@ -545,7 +545,7 @@ (module ;; CHECK: (type $struct (sub (struct (field (mut i32))))) (type $struct (sub (struct (mut i32)))) - (type $substruct (struct_subtype (mut i32) $struct)) + (type $substruct (sub $struct (struct (mut i32)))) ;; CHECK: (type $1 (func)) @@ -604,7 +604,7 @@ (module ;; CHECK: (type $struct (sub (struct (field (mut i32))))) (type $struct (sub (struct (mut i32)))) - (type $substruct (struct_subtype (mut i32) $struct)) + (type $substruct (sub $struct (struct (mut i32)))) ;; CHECK: (type $1 (func)) @@ -657,7 +657,7 @@ (module (type $struct (sub (struct i32))) - (type $substruct (struct_subtype i32 f64 $struct)) + (type $substruct (sub $struct (struct i32 f64))) ;; CHECK: (type $0 (func)) @@ -688,7 +688,7 @@ ;; CHECK: (type $2 (func)) ;; CHECK: (type $substruct (sub $struct (struct (field i32) (field f64)))) - (type $substruct (struct_subtype i32 f64 $struct)) + (type $substruct (sub $struct (struct i32 f64))) ;; CHECK: (import "a" "b" (func $import (type $1) (result i32))) (import "a" "b" (func $import (result i32))) @@ -742,7 +742,7 @@ ;; CHECK: (type $2 (func)) ;; CHECK: (type $substruct (sub $struct (struct (field i32) (field f64)))) - (type $substruct (struct_subtype i32 f64 $struct)) + (type $substruct (sub $struct (struct i32 f64))) ;; CHECK: (import "a" "b" (func $import (type $1) (result i32))) (import "a" "b" (func $import (result i32))) @@ -790,7 +790,7 @@ (type $struct (sub (struct i32))) ;; CHECK: (type $substruct (sub $struct (struct (field i32) (field f64)))) - (type $substruct (struct_subtype i32 f64 $struct)) + (type $substruct (sub $struct (struct i32 f64))) ;; CHECK: (type $2 (func (result i32))) @@ -847,7 +847,7 @@ (type $struct (sub (struct (mut i32)))) ;; CHECK: (type $substruct (sub $struct (struct (field (mut i32)) (field f64)))) - (type $substruct (struct_subtype (mut i32) f64 $struct)) + (type $substruct (sub $struct (struct (mut i32) f64))) ;; CHECK: (type $2 (func (result i32))) @@ -921,7 +921,7 @@ (type $struct (sub (struct (mut i32)))) ;; CHECK: (type $substruct (sub $struct (struct (field (mut i32)) (field f64)))) - (type $substruct (struct_subtype (mut i32) f64 $struct)) + (type $substruct (sub $struct (struct (mut i32) f64))) ;; CHECK: (type $2 (func (result i32))) @@ -997,13 +997,13 @@ ;; supertype but all the way as needed. (module ;; CHECK: (type $struct1 (sub (struct (field i32)))) - (type $struct1 (struct_subtype i32 data)) + (type $struct1 (sub (struct i32))) ;; CHECK: (type $struct2 (sub $struct1 (struct (field i32) (field f64)))) - (type $struct2 (struct_subtype i32 f64 $struct1)) + (type $struct2 (sub $struct1 (struct i32 f64))) ;; CHECK: (type $struct3 (sub $struct2 (struct (field i32) (field f64) (field anyref)))) - (type $struct3 (struct_subtype i32 f64 anyref $struct2)) + (type $struct3 (sub $struct2 (struct i32 f64 anyref))) ;; CHECK: (type $3 (func (result (ref $struct3)))) @@ -1141,10 +1141,10 @@ (type $struct1 (sub (struct i32 i32))) ;; CHECK: (type $struct2 (sub $struct1 (struct (field i32) (field i32) (field f64) (field f64)))) - (type $struct2 (struct_subtype i32 i32 f64 f64 $struct1)) + (type $struct2 (sub $struct1 (struct i32 i32 f64 f64))) ;; 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)) + (type $struct3 (sub $struct2 (struct i32 i32 f64 f64 anyref anyref))) ;; CHECK: (type $3 (func)) @@ -1374,11 +1374,11 @@ ;; CHECK: (type $struct1 (sub (struct (field (mut i32))))) (type $struct1 (sub (struct (mut i32)))) ;; CHECK: (type $struct2 (sub $struct1 (struct (field (mut i32)) (field f64)))) - (type $struct2 (struct_subtype (mut i32) f64 $struct1)) + (type $struct2 (sub $struct1 (struct (mut i32) f64))) ;; CHECK: (type $2 (func)) ;; CHECK: (type $struct3 (sub $struct2 (struct (field (mut i32)) (field f64) (field anyref)))) - (type $struct3 (struct_subtype (mut i32) f64 anyref $struct2)) + (type $struct3 (sub $struct2 (struct (mut i32) f64 anyref))) ;; CHECK: (type $4 (func (result i32))) @@ -1679,9 +1679,9 @@ ;; CHECK: (type $struct1 (sub (struct (field (mut i32))))) (type $struct1 (sub (struct (mut i32)))) ;; CHECK: (type $struct2 (sub $struct1 (struct (field (mut i32)) (field f64)))) - (type $struct2 (struct_subtype (mut i32) f64 $struct1)) + (type $struct2 (sub $struct1 (struct (mut i32) f64))) ;; CHECK: (type $struct3 (sub $struct2 (struct (field (mut i32)) (field f64) (field anyref)))) - (type $struct3 (struct_subtype (mut i32) f64 anyref $struct2)) + (type $struct3 (sub $struct2 (struct (mut i32) f64 anyref))) ;; CHECK: (type $3 (func (result i32))) @@ -1795,9 +1795,9 @@ ;; CHECK: (type $struct1 (sub (struct (field (mut i32))))) (type $struct1 (sub (struct (mut i32)))) ;; CHECK: (type $struct2 (sub $struct1 (struct (field (mut i32)) (field f64)))) - (type $struct2 (struct_subtype (mut i32) f64 $struct1)) + (type $struct2 (sub $struct1 (struct (mut i32) f64))) ;; CHECK: (type $struct3 (sub $struct2 (struct (field (mut i32)) (field f64) (field anyref)))) - (type $struct3 (struct_subtype (mut i32) f64 anyref $struct2)) + (type $struct3 (sub $struct2 (struct (mut i32) f64 anyref))) ;; CHECK: (type $3 (func (result i32))) @@ -2023,10 +2023,10 @@ (type $A (sub (struct (mut i32)))) ;; CHECK: (type $B (sub $A (struct (field (mut i32))))) - (type $B (struct_subtype (mut i32) $A)) + (type $B (sub $A (struct (mut i32)))) ;; CHECK: (type $C (sub $B (struct (field (mut i32))))) - (type $C (struct_subtype (mut i32) $B)) + (type $C (sub $B (struct (mut i32)))) ;; CHECK: (type $3 (func)) diff --git a/test/lit/passes/inlining_vacuum_optimize-instructions.wast b/test/lit/passes/inlining_vacuum_optimize-instructions.wast index 948fe467f..f93dca217 100644 --- a/test/lit/passes/inlining_vacuum_optimize-instructions.wast +++ b/test/lit/passes/inlining_vacuum_optimize-instructions.wast @@ -12,9 +12,9 @@ ;; there. (module ;; CHECK: (type $B (sub (struct ))) - (type $B (struct_subtype data)) + (type $B (sub (struct ))) ;; CHECK: (type $A (sub (struct (field (ref null $B))))) - (type $A (struct_subtype (field (ref null $B)) data)) + (type $A (sub (struct (field (ref null $B))))) ;; CHECK: (type $2 (func (param (ref null $A)))) ;; CHECK: (func $target (type $2) (param $0 (ref null $A)) diff --git a/test/lit/passes/local-subtyping.wast b/test/lit/passes/local-subtyping.wast index 3d4d392a9..38571e703 100644 --- a/test/lit/passes/local-subtyping.wast +++ b/test/lit/passes/local-subtyping.wast @@ -8,11 +8,11 @@ ;; testcases. (module - (type ${} (struct_subtype data)) + (type ${} (sub (struct))) - (type ${i32} (struct_subtype (field i32) data)) + (type ${i32} (sub (struct (field i32)))) - (type $array (array_subtype i8 data)) + (type $array (sub (array i8))) ;; CHECK: (type $ret-any (sub (func (result anyref)))) (type $ret-any (sub (func (result anyref)))) diff --git a/test/lit/passes/merge-similar-functions_types.wast b/test/lit/passes/merge-similar-functions_types.wast index 5c4364a14..717777ab7 100644 --- a/test/lit/passes/merge-similar-functions_types.wast +++ b/test/lit/passes/merge-similar-functions_types.wast @@ -7,11 +7,11 @@ ;; However, their nominal types differ, so in nominal typing we cannot do so. (module ;; CHECK: (type $type$0 (sub (func))) - (type $type$0 (func_subtype func)) - (type $type$1 (func_subtype func)) - (type $type$2 (func_subtype func)) - (type $type$3 (func_subtype (param f32) (result f32) func)) - (type $type$4 (func_subtype (param f64) (result f64) func)) + (type $type$0 (sub (func))) + (type $type$1 (sub (func))) + (type $type$2 (sub (func))) + (type $type$3 (sub (func (param f32) (result f32)))) + (type $type$4 (sub (func (param f64) (result f64)))) ;; CHECK: (type $1 (func (param (ref $type$0)))) ;; CHECK: (elem declare func $2 $3) @@ -111,10 +111,10 @@ ;; As above, but now the nominal types do match, so we can optimize in all ;; modes. ;; CHECK: (type $type$0 (sub (func))) - (type $type$0 (func_subtype func)) - (type $type$1 (func_subtype func)) - (type $type$3 (func_subtype (param f32) (result f32) func)) - (type $type$4 (func_subtype (param f64) (result f64) func)) + (type $type$0 (sub (func))) + (type $type$1 (sub (func))) + (type $type$3 (sub (func (param f32) (result f32)))) + (type $type$4 (sub (func (param f64) (result f64)))) ;; CHECK: (type $1 (func (param (ref $type$0)))) diff --git a/test/lit/passes/monomorphize.wast b/test/lit/passes/monomorphize.wast index 858cb4bf5..0974978b9 100644 --- a/test/lit/passes/monomorphize.wast +++ b/test/lit/passes/monomorphize.wast @@ -9,10 +9,10 @@ (module ;; ALWAYS: (type $A (sub (struct ))) ;; CAREFUL: (type $A (sub (struct ))) - (type $A (struct_subtype data)) + (type $A (sub (struct))) ;; ALWAYS: (type $B (sub $A (struct ))) ;; CAREFUL: (type $B (sub $A (struct ))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) ;; ALWAYS: (type $2 (func (param (ref $A)))) @@ -128,10 +128,10 @@ ;; CAREFUL: (type $0 (func)) ;; CAREFUL: (type $A (sub (struct ))) - (type $A (struct_subtype data)) + (type $A (sub (struct))) ;; ALWAYS: (type $B (sub $A (struct ))) ;; CAREFUL: (type $B (sub $A (struct ))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) @@ -208,10 +208,10 @@ ;; CAREFUL: (type $0 (func)) ;; CAREFUL: (type $A (sub (struct ))) - (type $A (struct_subtype data)) + (type $A (sub (struct))) ;; ALWAYS: (type $B (sub $A (struct ))) ;; CAREFUL: (type $B (sub $A (struct ))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) ;; ALWAYS: (type $2 (func)) @@ -219,7 +219,7 @@ ;; CAREFUL: (type $3 (func (param (ref $A)))) ;; CAREFUL: (type $C (sub $B (struct ))) - (type $C (struct_subtype $B)) + (type $C (sub $B (struct))) ;; ALWAYS: (type $4 (func (param (ref $A)))) @@ -329,11 +329,11 @@ ;; ALWAYS: (type $A (sub (struct ))) ;; CAREFUL: (type $A (sub (struct ))) - (type $A (struct_subtype data)) + (type $A (sub (struct))) ;; ALWAYS: (type $B (sub $A (struct ))) ;; CAREFUL: (type $B (sub $A (struct ))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) ;; ALWAYS: (type $2 (func (param (ref $B)))) @@ -560,14 +560,14 @@ ;; ALWAYS: (type $A (sub (struct ))) ;; CAREFUL: (type $A (sub (struct ))) - (type $A (struct_subtype data)) + (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 (struct_subtype $A)) + (type $B (sub $A (struct))) ;; ALWAYS: (func $calls (type $1) (param $ref (ref $A)) diff --git a/test/lit/passes/optimize-casts-tnh.wast b/test/lit/passes/optimize-casts-tnh.wast index d5f83f024..a03994705 100644 --- a/test/lit/passes/optimize-casts-tnh.wast +++ b/test/lit/passes/optimize-casts-tnh.wast @@ -3,7 +3,7 @@ (module ;; CHECK: (type $A (sub (struct ))) - (type $A (struct_subtype data)) + (type $A (sub (struct))) ;; CHECK: (global $a (mut i32) (i32.const 0)) (global $a (mut i32) (i32.const 0)) @@ -42,4 +42,3 @@ ) ) ) - diff --git a/test/lit/passes/optimize-casts.wast b/test/lit/passes/optimize-casts.wast index 2854df3bb..d0b4d05d7 100644 --- a/test/lit/passes/optimize-casts.wast +++ b/test/lit/passes/optimize-casts.wast @@ -3,10 +3,10 @@ (module ;; CHECK: (type $A (sub (struct ))) - (type $A (struct_subtype data)) + (type $A (sub (struct))) ;; CHECK: (type $B (sub $A (struct ))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) ;; CHECK: (type $void (func)) diff --git a/test/lit/passes/optimize-instructions-gc-iit.wast b/test/lit/passes/optimize-instructions-gc-iit.wast index cc5e8aec9..1cd92d98a 100644 --- a/test/lit/passes/optimize-instructions-gc-iit.wast +++ b/test/lit/passes/optimize-instructions-gc-iit.wast @@ -13,7 +13,7 @@ (type $parent (sub (struct (field i32)))) ;; 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)) + (type $child (sub $parent (struct (field i32) (field f64)))) ;; CHECK: (type $other (struct (field i64) (field f32))) ;; TNH: (type $other (struct (field i64) (field f32))) (type $other (struct (field i64) (field f32))) @@ -203,16 +203,16 @@ ;; CHECK-NEXT: (type $A (sub (struct ))) ;; TNH: (rec ;; TNH-NEXT: (type $A (sub (struct ))) - (type $A (struct_subtype data)) + (type $A (sub (struct ))) ;; 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)) + (type $B (sub $A (struct (field (ref null $A))))) ;; 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)) + (type $C (sub $B (struct (field (ref null $D))))) ;; CHECK: (type $D (sub $A (struct ))) ;; TNH: (type $D (sub $A (struct ))) - (type $D (struct_subtype $A)) + (type $D (sub $A (struct ))) ) ;; CHECK: (func $test (type $4) (param $C (ref $C)) (result anyref) diff --git a/test/lit/passes/optimize-instructions-gc-tnh.wast b/test/lit/passes/optimize-instructions-gc-tnh.wast index 9d55ef801..98372bed2 100644 --- a/test/lit/passes/optimize-instructions-gc-tnh.wast +++ b/test/lit/passes/optimize-instructions-gc-tnh.wast @@ -5,7 +5,7 @@ (module ;; TNH: (type $struct (sub (struct (field (mut i32))))) ;; NO_TNH: (type $struct (sub (struct (field (mut i32))))) - (type $struct (struct_subtype (field (mut i32)) data)) + (type $struct (sub (struct (field (mut i32))))) ;; TNH: (type $void (func)) ;; NO_TNH: (type $void (func)) diff --git a/test/lit/passes/optimize-instructions-gc.wast b/test/lit/passes/optimize-instructions-gc.wast index e62b64125..cbf44aee4 100644 --- a/test/lit/passes/optimize-instructions-gc.wast +++ b/test/lit/passes/optimize-instructions-gc.wast @@ -20,10 +20,10 @@ ;; CHECK: (type $array (array (mut i8))) (type $array (array (mut i8))) - (type $B (struct_subtype (field i32) (field i32) (field f32) $A)) + (type $B (sub $A (struct (field i32) (field i32) (field f32)))) ;; 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 $B-child (sub $B (struct (field i32) (field i32) (field f32) (field i64)))) (type $empty (struct)) @@ -32,11 +32,11 @@ ;; CHECK: (type $void2 (sub $void (func))) ;; CHECK: (type $C (sub $A (struct (field i32) (field i32) (field f64)))) - (type $C (struct_subtype (field i32) (field i32) (field f64) $A)) + (type $C (sub $A (struct (field i32) (field i32) (field f64)))) (type $void (sub (func))) - (type $void2 (func_subtype $void)) + (type $void2 (sub $void (func))) ;; CHECK: (type $struct_i64 (func (param structref) (result i64))) (type $struct_i64 (func (param (ref null struct)) (result i64))) diff --git a/test/lit/passes/remove-unused-module-elements-refs.wast b/test/lit/passes/remove-unused-module-elements-refs.wast index 8a7ef42da..00ea9767f 100644 --- a/test/lit/passes/remove-unused-module-elements-refs.wast +++ b/test/lit/passes/remove-unused-module-elements-refs.wast @@ -16,11 +16,11 @@ ;; CHECK: (type $A (sub $A-super (func))) ;; OPEN_WORLD: (type $A (sub $A-super (func))) - (type $A (func_subtype $A-super)) + (type $A (sub $A-super (func))) ;; CHECK: (type $A-sub (sub $A (func))) ;; OPEN_WORLD: (type $A-sub (sub $A (func))) - (type $A-sub (func_subtype $A)) + (type $A-sub (sub $A (func))) ;; CHECK: (type $B (func)) ;; OPEN_WORLD: (type $B (func)) @@ -636,7 +636,7 @@ ;; CHECK: (type $vtable (sub (struct (field (ref $void)) (field (ref $void))))) ;; OPEN_WORLD: (type $vtable (sub (struct (field (ref $void)) (field (ref $void))))) - (type $vtable (struct_subtype (field (ref $void)) (field (ref $void)) data)) + (type $vtable (sub (struct (field (ref $void)) (field (ref $void))))) ;; CHECK: (global $vtable (ref $vtable) (struct.new $vtable ;; CHECK-NEXT: (ref.func $a) @@ -756,11 +756,11 @@ ;; CHECK: (type $vtable (sub (struct (field (ref $void)) (field (ref $void))))) ;; OPEN_WORLD: (type $vtable (sub (struct (field (ref $void)) (field (ref $void))))) - (type $vtable (struct_subtype (field (ref $void)) (field (ref $void)) data)) + (type $vtable (sub (struct (field (ref $void)) (field (ref $void))))) ;; CHECK: (type $struct (sub (struct (field (ref $vtable)) (field (ref $vtable)) (field (ref $vtable)) (field (ref $vtable))))) ;; OPEN_WORLD: (type $struct (sub (struct (field (ref $vtable)) (field (ref $vtable)) (field (ref $vtable)) (field (ref $vtable))))) - (type $struct (struct_subtype (field (ref $vtable)) (field (ref $vtable)) (field (ref $vtable)) (field (ref $vtable)) data)) + (type $struct (sub (struct (field (ref $vtable)) (field (ref $vtable)) (field (ref $vtable)) (field (ref $vtable))))) ;; CHECK: (global $vtable (ref $vtable) (struct.new $vtable ;; CHECK-NEXT: (ref.func $a) @@ -1072,7 +1072,7 @@ ;; CHECK: (type $vtable (sub (struct (field (ref $void)) (field (ref $void))))) ;; OPEN_WORLD: (type $vtable (sub (struct (field (ref $void)) (field (ref $void))))) - (type $vtable (struct_subtype (field (ref $void)) (field (ref $void)) data)) + (type $vtable (sub (struct (field (ref $void)) (field (ref $void))))) ;; CHECK: (elem declare func $a $b $void) @@ -1176,7 +1176,7 @@ (type $vtable-func (func (param (ref $vtable)))) ;; CHECK: (type $vtable (sub (struct (field (ref $vtable-func)) (field (ref $vtable-func))))) ;; OPEN_WORLD: (type $vtable (sub (struct (field (ref $vtable-func)) (field (ref $vtable-func))))) - (type $vtable (struct_subtype (field (ref $vtable-func)) (field (ref $vtable-func)) data)) + (type $vtable (sub (struct (field (ref $vtable-func)) (field (ref $vtable-func))))) ) ;; CHECK: (type $2 (func)) @@ -1374,11 +1374,11 @@ ;; CHECK: (type $substruct (sub $struct (struct (field funcref)))) ;; OPEN_WORLD: (type $substruct (sub $struct (struct (field funcref)))) - (type $substruct (struct_subtype (field funcref) $struct)) + (type $substruct (sub $struct (struct (field funcref)))) ;; CHECK: (type $subsubstruct (sub $substruct (struct (field funcref)))) ;; OPEN_WORLD: (type $subsubstruct (sub $substruct (struct (field funcref)))) - (type $subsubstruct (struct_subtype (field funcref) $substruct)) + (type $subsubstruct (sub $substruct (struct (field funcref)))) ;; CHECK: (global $g (ref $struct) (struct.new $struct ;; CHECK-NEXT: (ref.func $f) diff --git a/test/lit/passes/roundtrip-gc-types.wast b/test/lit/passes/roundtrip-gc-types.wast index c3b3e93c1..8f1bf4e82 100644 --- a/test/lit/passes/roundtrip-gc-types.wast +++ b/test/lit/passes/roundtrip-gc-types.wast @@ -19,7 +19,7 @@ (type $C (struct (field (mut (ref $B))))) ;; CHECK: (type $D (sub $A (struct (field (ref $C)) (field (ref $A))))) - (type $D (struct_subtype (field (ref $C)) (field (ref $A)) $A)) + (type $D (sub $A (struct (field (ref $C)) (field (ref $A))))) ) ;; CHECK: (func $use-types (type $4) (param $0 (ref $A)) (param $1 (ref $D)) diff --git a/test/lit/passes/rse-gc.wast b/test/lit/passes/rse-gc.wast index 1dbc61574..367f3ce18 100644 --- a/test/lit/passes/rse-gc.wast +++ b/test/lit/passes/rse-gc.wast @@ -8,7 +8,7 @@ ;; $B is a subtype of $A, and its field has a more refined type (it is non- ;; nullable). ;; CHECK: (type $B (sub $A (struct (field (ref struct))))) - (type $B (struct_subtype (field (ref struct)) $A)) + (type $B (sub $A (struct (field (ref struct))))) ;; CHECK: (func $test (type $3) ;; CHECK-NEXT: (local $single (ref func)) diff --git a/test/lit/passes/signature-pruning.wast b/test/lit/passes/signature-pruning.wast index eaa05ac46..cf6485f63 100644 --- a/test/lit/passes/signature-pruning.wast +++ b/test/lit/passes/signature-pruning.wast @@ -6,7 +6,7 @@ ;; CHECK-NEXT: (type $0 (func)) ;; CHECK: (type $sig (sub (func (param i32 f64)))) - (type $sig (func_subtype (param i32) (param i64) (param f32) (param f64) func)) + (type $sig (sub (func (param i32) (param i64) (param f32) (param f64)))) (memory 1 1) @@ -72,7 +72,7 @@ ;; CHECK-NEXT: (type $0 (func)) ;; CHECK: (type $sig (sub (func (param i64 f32)))) - (type $sig (func_subtype (param i32) (param i64) (param f32) (param f64) func)) + (type $sig (sub (func (param i32) (param i64) (param f32) (param f64)))) (memory 1 1) @@ -137,7 +137,7 @@ ;; CHECK-NEXT: (type $0 (func)) ;; CHECK: (type $sig (sub (func (param i32 i64 f32)))) - (type $sig (func_subtype (param i32) (param i64) (param f32) (param f64) func)) + (type $sig (sub (func (param i32) (param i64) (param f32) (param f64)))) (memory 1 1) @@ -214,7 +214,7 @@ ;; CHECK-NEXT: (type $0 (func)) ;; CHECK: (type $sig (sub (func (param i32 i64 f32)))) - (type $sig (func_subtype (param i32) (param i64) (param f32) (param f64) func)) + (type $sig (sub (func (param i32) (param i64) (param f32) (param f64)))) (memory 1 1) @@ -285,7 +285,7 @@ ;; CHECK-NEXT: (type $0 (func)) ;; CHECK: (type $sig (sub (func))) - (type $sig (func_subtype (param i32) (param i64) (param f32) (param f64) func)) + (type $sig (sub (func (param i32) (param i64) (param f32) (param f64)))) (memory 1 1) @@ -332,7 +332,7 @@ ;; CHECK-NEXT: (type $0 (func)) ;; CHECK: (type $sig (sub (func))) - (type $sig (func_subtype (param i32) func)) + (type $sig (sub (func (param i32)))) (memory 1 1) @@ -376,7 +376,7 @@ (module ;; CHECK: (type $sig (sub (func))) - (type $sig (func_subtype (param i32) func)) + (type $sig (sub (func (param i32)))) (memory 1 1) @@ -394,7 +394,7 @@ (module ;; CHECK: (type $sig (sub (func (param i32)))) - (type $sig (func_subtype (param i32) func)) + (type $sig (sub (func (param i32)))) ;; As above, but now an import also uses this signature, which prevents us ;; from changing anything. @@ -414,7 +414,7 @@ (module ;; CHECK: (type $sig (sub (func (param i32)))) - (type $sig (func_subtype (param i32) func)) + (type $sig (sub (func (param i32)))) (memory 1 1) @@ -448,9 +448,9 @@ ;; CHECK-NEXT: (type $sig2 (sub (func (param i32)))) ;; CHECK: (type $sig (sub (func))) - (type $sig (func_subtype (param i32) func)) + (type $sig (sub (func (param i32)))) - (type $sig2 (func_subtype (param i32) func)) + (type $sig2 (sub (func (param i32)))) ) (memory 1 1) @@ -485,7 +485,7 @@ ;; CHECK-NEXT: (type $0 (func)) ;; CHECK: (type $sig (sub (func))) - (type $sig (func_subtype (param i32) func)) + (type $sig (sub (func (param i32)))) (memory 1 1) @@ -559,7 +559,7 @@ (table 1 1 anyref) ;; CHECK: (type $sig (sub (func (param i32)))) - (type $sig (func_subtype (param i32) func)) + (type $sig (sub (func (param i32)))) ;; CHECK: (table $0 1 1 anyref) @@ -574,7 +574,7 @@ ;; them, and also we cannot apply constant parameter values either. (module ;; CHECK: (type $sig (sub (func (param i32)))) - (type $sig (func_subtype (param i32) func)) + (type $sig (sub (func (param i32)))) ;; CHECK: (type $1 (func)) @@ -616,8 +616,8 @@ ;; CHECK-NEXT: (type $sig2 (sub (func))) ;; CHECK: (type $sig1 (sub (func))) - (type $sig1 (func_subtype (param i32) func)) - (type $sig2 (func_subtype (param f64) func)) + (type $sig1 (sub (func (param i32)))) + (type $sig2 (sub (func (param f64)))) ) ;; CHECK: (func $foo1 (type $sig1) @@ -641,8 +641,8 @@ ;; CHECK-NEXT: (type $sig-bar (sub (func (param i32)))) ;; CHECK: (type $sig-foo (sub (func))) - (type $sig-foo (func_subtype (param i32) func)) - (type $sig-bar (func_subtype (param i32) func)) + (type $sig-foo (sub (func (param i32)))) + (type $sig-bar (sub (func (param i32)))) ) (memory 1 1) @@ -709,8 +709,8 @@ ;; CHECK-NEXT: (type $sig-bar (sub (func (param funcref)))) ;; CHECK: (type $sig-foo (sub (func))) - (type $sig-foo (func_subtype (param funcref) func)) - (type $sig-bar (func_subtype (param funcref) func)) + (type $sig-foo (sub (func (param funcref)))) + (type $sig-bar (sub (func (param funcref)))) ) (memory 1 1) @@ -765,8 +765,8 @@ ;; CHECK-NEXT: (type $sig-bar (sub (func (param anyref)))) ;; CHECK: (type $sig-foo (sub (func))) - (type $sig-foo (func_subtype (param anyref) func)) - (type $sig-bar (func_subtype (param anyref) func)) + (type $sig-foo (sub (func (param anyref)))) + (type $sig-bar (sub (func (param anyref)))) ) (memory 1 1) @@ -887,16 +887,16 @@ ;; CHECK: (type $array.A (sub (array (ref $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 $struct.B (sub $struct.A (struct (field i32) (field i64)))) (type $array.A (sub (array (ref $struct.A)))) ;; CHECK: (type $array.B (sub $array.A (array (ref $struct.B)))) - (type $array.B (array_subtype (ref $struct.B) $array.A)) + (type $array.B (sub $array.A (array (ref $struct.B)))) ;; CHECK: (type $func.A (sub (func (param (ref $array.B)) (result (ref $array.A))))) (type $func.A (sub (func (param (ref $array.B)) (result (ref $array.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)) + (type $func.B (sub $func.A (func (param (ref $array.A)) (result (ref $array.B))))) ;; CHECK: (func $func.A (type $func.A) (param $0 (ref $array.B)) (result (ref $array.A)) ;; CHECK-NEXT: (unreachable) diff --git a/test/lit/passes/signature-refining.wast b/test/lit/passes/signature-refining.wast index 6516b4a24..c2a505e51 100644 --- a/test/lit/passes/signature-refining.wast +++ b/test/lit/passes/signature-refining.wast @@ -14,7 +14,7 @@ ;; CHECK: (type $1 (func)) ;; CHECK: (type $sig (sub (func (param (ref $struct))))) - (type $sig (func_subtype (param anyref) func)) + (type $sig (sub (func (param anyref)))) ;; CHECK: (func $func (type $sig) (param $x (ref $struct)) ;; CHECK-NEXT: (nop) @@ -44,7 +44,7 @@ ;; CHECK: (type $1 (func)) ;; CHECK: (type $sig (sub (func (param (ref $struct))))) - (type $sig (func_subtype (param anyref) func)) + (type $sig (sub (func (param anyref)))) ;; CHECK: (elem declare func $func) @@ -80,7 +80,7 @@ ;; CHECK: (type $1 (func)) ;; CHECK: (type $sig (sub (func (param eqref)))) - (type $sig (func_subtype (param anyref) func)) + (type $sig (sub (func (param anyref)))) ;; CHECK: (elem declare func $func) @@ -130,13 +130,13 @@ ;; CHECK: (type $3 (func)) ;; CHECK: (type $sig (sub (func (param (ref $struct))))) - (type $sig (func_subtype (param anyref) func)) + (type $sig (sub (func (param anyref)))) (type $struct (sub (struct))) - (type $struct-sub1 (struct_subtype $struct)) + (type $struct-sub1 (sub $struct (struct))) - (type $struct-sub2 (struct_subtype $struct)) + (type $struct-sub2 (sub $struct (struct))) ) ;; CHECK: (func $func-1 (type $sig) (param $x (ref $struct)) @@ -179,7 +179,7 @@ ;; CHECK: (type $1 (func)) ;; CHECK: (type $sig (sub (func (param (ref $struct))))) - (type $sig (func_subtype (param anyref) func)) + (type $sig (sub (func (param anyref)))) (type $struct (struct)) @@ -217,9 +217,9 @@ ;; CHECK: (type $1 (func)) ;; CHECK: (type $sig (sub (func (param (ref $struct) (ref $sig))))) - (type $sig (func_subtype (param anyref funcref) func)) + (type $sig (sub (func (param anyref funcref)))) - (type $struct (struct_subtype (field (ref $sig)) data)) + (type $struct (sub (struct (field (ref $sig))))) ;; CHECK: (elem declare func $func) @@ -283,7 +283,7 @@ ;; CHECK: (type $1 (func)) ;; CHECK: (type $sig (sub (func (param (ref $struct))))) - (type $sig (func_subtype (param anyref) func)) + (type $sig (sub (func (param anyref)))) ;; CHECK: (elem declare func $func) @@ -320,7 +320,7 @@ (type $struct (struct)) ;; CHECK: (type $sig (sub (func (param anyref)))) - (type $sig (func_subtype (param anyref) func)) + (type $sig (sub (func (param anyref)))) ;; CHECK: (type $1 (func)) @@ -353,7 +353,7 @@ (type $struct (struct)) ;; CHECK: (type $sig (sub (func (param anyref)))) - (type $sig (func_subtype (param anyref) func)) + (type $sig (sub (func (param anyref)))) ;; CHECK: (func $func (type $sig) (param $x anyref) ;; CHECK-NEXT: (nop) @@ -374,8 +374,8 @@ ;; CHECK: (type $sig-2 (sub (func (param eqref (ref $struct))))) ;; CHECK: (type $sig-1 (sub (func (param structref anyref)))) - (type $sig-1 (func_subtype (param anyref) (param anyref) func)) - (type $sig-2 (func_subtype (param anyref) (param anyref) func)) + (type $sig-1 (sub (func (param anyref) (param anyref)))) + (type $sig-2 (sub (func (param anyref) (param anyref)))) ) ;; CHECK: (elem declare func $func-2) @@ -443,7 +443,7 @@ ;; The presence of a table prevents us from doing any optimizations. ;; CHECK: (type $sig (sub (func (param anyref)))) - (type $sig (func_subtype (param anyref) func)) + (type $sig (sub (func (param anyref)))) ;; CHECK: (type $1 (func)) @@ -482,7 +482,7 @@ ;; CHECK: (type $1 (func)) ;; CHECK: (type $sig (sub (func (param (ref null $struct))))) - (type $sig (func_subtype (param anyref) func)) + (type $sig (sub (func (param anyref)))) (type $struct (struct)) @@ -525,13 +525,13 @@ ;; This signature has a single function using it, which returns a more ;; refined type, and we can refine to that. ;; CHECK: (type $sig-can-refine (sub (func (result (ref $struct))))) - (type $sig-can-refine (func_subtype (result anyref) func)) + (type $sig-can-refine (sub (func (result anyref)))) ;; Also a single function, but no refinement is possible. - (type $sig-cannot-refine (func_subtype (result (ref func)) func)) + (type $sig-cannot-refine (sub (func (result (ref func))))) ;; The single function never returns, so no refinement is possible. - (type $sig-unreachable (func_subtype (result anyref) func)) + (type $sig-unreachable (sub (func (result anyref)))) ) ;; CHECK: (elem declare func $func-can-refine $func-cannot-refine) @@ -615,7 +615,7 @@ ;; This signature has multiple functions using it, and some of them have nulls ;; which should be updated when we refine. ;; CHECK: (type $sig (sub (func (result (ref null $struct))))) - (type $sig (func_subtype (result anyref) func)) + (type $sig (sub (func (result anyref)))) ;; CHECK: (func $func-1 (type $sig) (result (ref null $struct)) ;; CHECK-NEXT: (struct.new_default $struct) @@ -667,7 +667,7 @@ ;; CHECK: (type $struct (struct )) (type $struct (struct)) - (type $sig (func_subtype (param anyref) func)) + (type $sig (sub (func (param anyref)))) ;; CHECK: (export "prevent-opts" (func $func)) @@ -691,9 +691,9 @@ (module ;; CHECK: (type $A (sub (func (param i32)))) - (type $A (func_subtype (param i32) func)) + (type $A (sub (func (param i32)))) ;; CHECK: (type $B (sub $A (func (param i32)))) - (type $B (func_subtype (param i32) $A)) + (type $B (sub $A (func (param i32)))) ;; CHECK: (func $bar (type $B) (param $x i32) ;; CHECK-NEXT: (nop) @@ -786,7 +786,7 @@ ;; CHECK-NEXT: (type $A (sub (func (param (ref null $B)) (result (ref null $A))))) (type $A (sub (func (param (ref null $B)) (result (ref null $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)) + (type $B (sub $A (func (param (ref null $A)) (result (ref null $B))))) ) ;; CHECK: (elem declare func $func) @@ -808,7 +808,7 @@ ;; CHECK: (type $parent (sub (func (param anyref)))) (type $parent (sub (func (param anyref)))) ;; CHECK: (type $child (sub $parent (func (param anyref)))) - (type $child (func_subtype (param anyref) $parent)) + (type $child (sub $parent (func (param anyref)))) ;; CHECK: (type $2 (func)) diff --git a/test/lit/passes/simplify-locals-gc.wast b/test/lit/passes/simplify-locals-gc.wast index 1de41e8e8..2c5f56952 100644 --- a/test/lit/passes/simplify-locals-gc.wast +++ b/test/lit/passes/simplify-locals-gc.wast @@ -14,11 +14,11 @@ ;; CHECK: (type $struct-immutable (struct (field i32))) (type $struct-immutable (struct (field i32))) - (type $A (struct_subtype (field (ref null struct)) data)) + (type $A (sub (struct (field (ref null struct))))) ;; $B is a subtype of $A, and its field has a more refined type (it is non- ;; nullable). - (type $B (struct_subtype (field (ref struct)) $A)) + (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) diff --git a/test/lit/passes/simplify-locals-strings.wast b/test/lit/passes/simplify-locals-strings.wast index d36db96ae..890364a83 100644 --- a/test/lit/passes/simplify-locals-strings.wast +++ b/test/lit/passes/simplify-locals-strings.wast @@ -6,9 +6,9 @@ (memory 10 10) ;; CHECK: (type $array (sub (array (mut i8)))) - (type $array (array_subtype (mut i8) data)) + (type $array (sub (array (mut i8)))) ;; CHECK: (type $array16 (sub (array (mut i16)))) - (type $array16 (array_subtype (mut i16) data)) + (type $array16 (sub (array (mut i16)))) ;; CHECK: (func $no-new-past-store (type $1) ;; CHECK-NEXT: (local $temp stringref) diff --git a/test/lit/passes/type-merging-tnh.wast b/test/lit/passes/type-merging-tnh.wast index 9df11164f..a82aa87e1 100644 --- a/test/lit/passes/type-merging-tnh.wast +++ b/test/lit/passes/type-merging-tnh.wast @@ -6,7 +6,7 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct ))) (type $A (sub (struct))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) ;; CHECK: (type $1 (func (param (ref $A)) (result (ref $A)))) @@ -28,7 +28,7 @@ ;; CHECK-NEXT: (type $A (sub (struct ))) (type $A (sub (struct))) ;; CHECK: (type $B (sub $A (struct ))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) ;; CHECK: (type $2 (func (param (ref $A)) (result i32))) @@ -50,7 +50,7 @@ ;; CHECK-NEXT: (type $A (sub (struct ))) (type $A (sub (struct))) ;; CHECK: (type $B (sub $A (struct ))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) ;; CHECK: (type $2 (func (param (ref $A)) (result (ref $B)))) @@ -95,7 +95,7 @@ (module ;; CHECK: (type $A (sub (func))) (type $A (sub (func))) - (type $B (func_subtype $A)) + (type $B (sub $A (func))) (table 1 1 (ref null $A)) diff --git a/test/lit/passes/type-merging.wast b/test/lit/passes/type-merging.wast index 4a68a9213..643e28bd9 100644 --- a/test/lit/passes/type-merging.wast +++ b/test/lit/passes/type-merging.wast @@ -5,8 +5,8 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct (field anyref)))) - (type $A (struct_subtype (field anyref) data)) - (type $B (struct_subtype (field anyref) $A)) + (type $A (sub (struct (field anyref)))) + (type $B (sub $A (struct (field anyref)))) ;; CHECK: (type $G (sub final $A (struct (field anyref)))) ;; CHECK: (type $F (sub $A (struct (field anyref)))) @@ -16,10 +16,10 @@ ;; CHECK: (type $D (sub $A (struct (field (ref any))))) ;; 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)) - (type $F (struct_subtype (field anyref) $A)) + (type $C (sub $A (struct (field anyref) (field f64)))) + (type $D (sub $A (struct (field (ref any))))) + (type $E (sub $A (struct (field eqref)))) + (type $F (sub $A (struct (field anyref)))) (type $G (sub final $A (struct (field anyref)))) ) @@ -79,14 +79,14 @@ (module ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct (field i32)))) - (type $A (struct_subtype (field i32) data)) - (type $B (struct_subtype (field i32) $A)) - (type $C (struct_subtype (field i32) $B)) + (type $A (sub (struct (field i32)))) + (type $B (sub $A (struct (field i32)))) + (type $C (sub $B (struct (field i32)))) ;; 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)) - (type $G (struct_subtype (field i32) (field f64) $F)) + (type $D (sub $A (struct (field i32) (field f64)))) + (type $E (sub $D (struct (field i32) (field f64)))) + (type $F (sub $E (struct (field i32) (field f64)))) + (type $G (sub $F (struct (field i32) (field f64)))) ;; CHECK: (type $2 (func)) @@ -123,14 +123,14 @@ (module ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct (field i32)))) - (type $A (struct_subtype (field i32) data)) - (type $B (struct_subtype (field i32) $A)) - (type $C (struct_subtype (field i32) $B)) + (type $A (sub (struct (field i32)))) + (type $B (sub $A (struct (field i32)))) + (type $C (sub $B (struct (field i32)))) ;; 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)) - (type $G (struct_subtype (field i32) (field f64) $F)) + (type $D (sub $C (struct (field i32) (field f64)))) ;; this line changed + (type $E (sub $D (struct (field i32) (field f64)))) + (type $F (sub $E (struct (field i32) (field f64)))) + (type $G (sub $F (struct (field i32) (field f64)))) ;; CHECK: (type $2 (func)) @@ -159,12 +159,12 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $X (sub (struct ))) (type $X (sub (struct))) - (type $Y (struct_subtype $X)) + (type $Y (sub $X (struct))) ;; CHECK: (type $A (sub (struct (field (ref null $X))))) (type $A (sub (struct (field (ref null $X))))) - (type $B (struct_subtype (field (ref null $Y)) $A)) + (type $B (sub $A (struct (field (ref null $Y))))) ;; CHECK: (type $C (sub $A (struct (field (ref $X))))) - (type $C (struct_subtype (field (ref $Y)) $A)) + (type $C (sub $A (struct (field (ref $Y))))) ;; CHECK: (type $3 (func)) @@ -188,7 +188,7 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct (field (ref null $A))))) (type $A (sub (struct (ref null $A)))) - (type $B (struct_subtype (ref null $B) $A)) + (type $B (sub $A (struct (ref null $B)))) ;; CHECK: (type $1 (func)) @@ -212,9 +212,9 @@ ;; CHECK: (type $A (sub (struct (field (ref null $X)) (field i32)))) (type $A (sub (struct (ref null $X) i32))) - (type $B (struct_subtype (ref null $Y) i32 $A)) + (type $B (sub $A (struct (ref null $Y) i32))) (type $X (sub (struct (ref null $A) f32))) - (type $Y (struct_subtype (ref null $B) f32 $X)) + (type $Y (sub $X (struct (ref null $B) f32))) ) ;; CHECK: (type $2 (func)) @@ -241,9 +241,9 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct (field (ref null $A))))) (type $A (sub (struct (ref null $X)))) - (type $B (struct_subtype (ref null $Y) $A)) + (type $B (sub $A (struct (ref null $Y)))) (type $X (sub (struct (ref null $A)))) - (type $Y (struct_subtype (ref null $B) $X)) + (type $Y (sub $X (struct (ref null $B)))) ) ;; CHECK: (type $1 (func)) @@ -329,9 +329,9 @@ ;; CHECK: (type $A (sub (struct (field (ref null $X))))) (type $A (sub (struct (ref null $X)))) - (type $B (struct_subtype (ref null $Y) $A)) + (type $B (sub $A (struct (ref null $Y)))) (type $X (sub (struct (ref null $A)))) - (type $Y (struct_subtype (ref null $B) $X)) + (type $Y (sub $X (struct (ref null $B)))) ) ;; CHECK: (type $2 (func)) @@ -484,12 +484,12 @@ ;; CHECK-NEXT: (type $X (sub (struct (field anyref)))) (type $X (sub (struct anyref))) ;; CHECK: (type $Y (sub $X (struct (field eqref)))) - (type $Y (struct_subtype eqref $X)) + (type $Y (sub $X (struct eqref))) ;; CHECK: (type $A (sub (struct (field (ref null $X))))) (type $A (sub (struct (ref null $X)))) ;; 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)) + (type $B (sub $A (struct (ref null $Y)))) + (type $C (sub $A (struct (ref null $Y)))) ;; CHECK: (type $4 (func)) @@ -513,9 +513,9 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct (field anyref)))) (type $A (sub (struct anyref))) - (type $B (struct_subtype eqref $A)) + (type $B (sub $A (struct eqref))) ;; CHECK: (type $C (sub $A (struct (field eqref)))) - (type $C (struct_subtype eqref $A)) + (type $C (sub $A (struct eqref))) ) ;; CHECK: (type $2 (func)) @@ -540,11 +540,11 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct (field anyref)))) (type $A (sub (struct anyref))) - (type $B (struct_subtype anyref $A)) - (type $C (struct_subtype anyref $A)) - (type $D (struct_subtype eqref $B)) + (type $B (sub $A (struct anyref))) + (type $C (sub $A (struct anyref))) + (type $D (sub $B (struct eqref))) ;; CHECK: (type $E (sub $A (struct (field eqref)))) - (type $E (struct_subtype eqref $C)) + (type $E (sub $C (struct eqref))) ) ;; CHECK: (type $2 (func)) @@ -582,19 +582,19 @@ ;; CHECK: (type $A (sub (struct ))) (type $A (sub (struct))) - (type $A' (struct_subtype $A)) + (type $A' (sub $A (struct))) ;; These siblings will be merged only after $a and $a' are merged. (type $B (sub (struct (ref $A)))) (type $B' (sub (struct (ref $A')))) ;; These will get merged only after $b and $b' are merged. - (type $C (struct_subtype (ref $A) i32 $B)) - (type $C' (struct_subtype (ref $A') i32 $B')) + (type $C (sub $B (struct (ref $A) i32))) + (type $C' (sub $B' (struct (ref $A') i32))) ;; These will get merged only after $c and $c' are merged. - (type $D (struct_subtype (ref $A) i32 i32 $C)) - (type $D' (struct_subtype (ref $A') i32 i32 $C')) + (type $D (sub $C (struct (ref $A) i32 i32))) + (type $D' (sub $C' (struct (ref $A') i32 i32))) ) ;; CHECK: (type $4 (func)) @@ -627,7 +627,7 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct ))) (type $A (sub (struct))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) ;; CHECK: (type $1 (func (result (ref null $A)))) @@ -664,15 +664,15 @@ ;; CHECK: (type $I (array (mut (ref null $C)))) (type $I (array (mut (ref null $C)))) (type $C (sub (struct (field (mut i32))))) - (type $D (struct_subtype (field (mut i32)) (field (mut i32)) $C)) - (type $E (struct_subtype (field (mut i32)) (field (mut i32)) $D)) - (type $F (struct_subtype (field (mut i32)) (field (mut i32)) $E)) - (type $D$to-merge (struct_subtype (field (mut i32)) (field (mut i32)) $F)) + (type $D (sub $C (struct (field (mut i32)) (field (mut i32))))) + (type $E (sub $D (struct (field (mut i32)) (field (mut i32))))) + (type $F (sub $E (struct (field (mut i32)) (field (mut i32))))) + (type $D$to-merge (sub $F (struct (field (mut i32)) (field (mut i32))))) ;; CHECK: (type $G (func (param (ref $C)) (result (ref $D)))) (type $G (func (param (ref $C)) (result (ref $D)))) - (type $H (struct_subtype (field (mut i32)) (field (mut i32)) (field (mut (ref null $E))) $D)) - (type $A (struct_subtype (field (mut i32)) (field (mut i32)) (field (mut (ref null $E))) (field (mut i64)) (field (mut (ref null $I))) $H)) - (type $A$to-merge (struct_subtype (field (mut i32)) (field (mut i32)) (field (mut (ref null $E))) (field (mut i64)) (field (mut (ref null $I))) $A)) + (type $H (sub $D (struct (field (mut i32)) (field (mut i32)) (field (mut (ref null $E)))))) + (type $A (sub $H (struct (field (mut i32)) (field (mut i32)) (field (mut (ref null $E))) (field (mut i64)) (field (mut (ref null $I)))))) + (type $A$to-merge (sub $A (struct (field (mut i32)) (field (mut i32)) (field (mut (ref null $E))) (field (mut i64)) (field (mut (ref null $I)))))) ) ;; CHECK: (global $global$0 (ref $D) (struct.new $D @@ -712,11 +712,11 @@ ;; CHECK: (type $intarray (sub (array (mut i32)))) (type $intarray (sub (array (mut i32)))) - (type $sub-intarray (array_subtype (mut i32) $intarray)) + (type $sub-intarray (sub $intarray (array (mut i32)))) (type $refarray (sub (array (ref null any)))) - (type $sub-refarray (array_subtype (ref null any) $refarray)) - (type $sub-refarray-nn (array_subtype (ref any) $refarray)) + (type $sub-refarray (sub $refarray (array (ref null any)))) + (type $sub-refarray-nn (sub $refarray (array (ref any)))) ;; CHECK: (type $3 (func)) @@ -752,9 +752,9 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $func (sub (func (param eqref)))) (type $func (sub (func (param eqref)))) - (type $sub-func (func_subtype (param eqref) $func)) + (type $sub-func (sub $func (func (param eqref)))) ;; CHECK: (type $sub-func-refined (sub $func (func (param anyref)))) - (type $sub-func-refined (func_subtype (param anyref) $func)) + (type $sub-func-refined (sub $func (func (param anyref)))) ;; CHECK: (type $2 (func)) @@ -779,8 +779,8 @@ ;; CHECK: (type $A (sub (func))) (type $A (sub (func))) ;; public ;; CHECK: (type $B (sub $A (func))) - (type $B (func_subtype $A)) ;; public - (type $C (func_subtype $B)) ;; private + (type $B (sub $A (func))) ;; public + (type $C (sub $B (func))) ;; private ;; CHECK: (type $2 (func (param (ref $A) (ref $B) (ref $B)))) @@ -827,7 +827,7 @@ (rec ;; CHECK: (type $A (sub (func (param (ref null $A)) (result (ref null $A))))) (type $A (sub (func (param (ref null $B)) (result (ref null $A))))) - (type $B (func_subtype (param (ref null $A)) (result (ref null $B)) $A)) + (type $B (sub $A (func (param (ref null $A)) (result (ref null $B))))) ) ;; CHECK: (func $0 (type $A) (param $0 (ref null $A)) (result (ref null $A)) @@ -846,7 +846,7 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct ))) (type $A (sub (struct))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) ;; CHECK: (type $X (struct (field (ref $A)))) (type $X (struct (ref $B))) ;; CHECK: (type $A' (struct )) @@ -879,7 +879,7 @@ ;; CHECK: (type $x (sub (struct (field anyref)))) (type $x (sub (struct anyref))) ;; CHECK: (type $y (sub $x (struct (field anyref)))) - (type $y (struct_subtype anyref $x)) + (type $y (sub $x (struct anyref))) ;; If we did vertical and horizontal merges at the same time, these three ;; types would be put into the same initial partition and $b1 would be merged @@ -888,7 +888,7 @@ ;; CHECK: (type $a (struct (field (ref null $y)))) (type $a (struct (ref null $y))) (type $b (sub (struct (ref null $x)))) - (type $b1 (struct_subtype (ref null $y) $b)) + (type $b1 (sub $b (struct (ref null $y)))) ) ;; CHECK: (type $5 (func (result (ref $b)))) @@ -1033,7 +1033,7 @@ ;; CHECK-NEXT: (type $A (sub (struct ))) (type $A (sub (struct))) ;; CHECK: (type $B (sub $A (struct ))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) ;; CHECK: (type $2 (func (param (ref $A)) (result i32))) @@ -1055,7 +1055,7 @@ ;; CHECK-NEXT: (type $A (sub (struct ))) (type $A (sub (struct))) ;; CHECK: (type $B (sub $A (struct ))) - (type $B (struct_subtype $A)) + (type $B (sub $A (struct))) ;; CHECK: (type $2 (func (param (ref $A)) (result (ref $B)))) @@ -1102,7 +1102,7 @@ ;; CHECK-NEXT: (type $A (sub (func))) (type $A (sub (func))) ;; CHECK: (type $B (sub $A (func))) - (type $B (func_subtype $A)) + (type $B (sub $A (func))) (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 ecc9b1f90..537f99e66 100644 --- a/test/lit/passes/type-refining-isorecursive.wast +++ b/test/lit/passes/type-refining-isorecursive.wast @@ -10,9 +10,9 @@ ;; CHECK: (type $1 (sub (struct (field nullfuncref) (field (ref $2))))) ;; CHECK: (type $0 (sub (struct (field nullref) (field (ref $1))))) - (type $0 (struct_subtype nullref anyref data)) - (type $1 (struct_subtype nullfuncref anyref data)) - (type $2 (struct_subtype nullexternref anyref data)) + (type $0 (sub (struct nullref anyref))) + (type $1 (sub (struct nullfuncref anyref))) + (type $2 (sub (struct nullexternref anyref))) ;; CHECK: (type $3 (func (param (ref $0) (ref $1) (ref $2)))) @@ -71,11 +71,11 @@ ;; CHECK: (type $2 (sub $1 (struct (field (ref null $all)) (field (ref $0))))) ;; CHECK: (type $all (sub (struct (field i32) (field (ref $0)) (field (ref $1)) (field (ref $2))))) - (type $all (struct_subtype i32 anyref anyref anyref data)) + (type $all (sub (struct i32 anyref anyref anyref))) - (type $0 (struct_subtype anyref anyref data)) - (type $1 (struct_subtype anyref anyref $0)) - (type $2 (struct_subtype anyref anyref $1)) + (type $0 (sub (struct anyref anyref))) + (type $1 (sub $0 (struct anyref anyref))) + (type $2 (sub $1 (struct anyref anyref))) ;; CHECK: (type $4 (func (param (ref $0) (ref $1) (ref $2)))) diff --git a/test/lit/passes/type-refining.wast b/test/lit/passes/type-refining.wast index e41cd9261..2f550cc37 100644 --- a/test/lit/passes/type-refining.wast +++ b/test/lit/passes/type-refining.wast @@ -7,7 +7,7 @@ ;; us to specialize that one. ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field (mut anyref)) (field (mut (ref i31))) (field (mut (ref i31)))))) - (type $struct (struct_subtype (field (mut anyref)) (field (mut (ref i31))) (field (mut anyref)) data)) + (type $struct (sub (struct (field (mut anyref)) (field (mut (ref i31))) (field (mut anyref))))) ;; CHECK: (type $1 (func (param (ref $struct)))) @@ -56,7 +56,7 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field (mut i31ref))))) - (type $struct (struct_subtype (field (mut anyref)) data)) + (type $struct (sub (struct (field (mut anyref))))) ;; CHECK: (type $1 (func (param (ref $struct)))) @@ -91,14 +91,14 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field (mut (ref $struct)))))) - (type $struct (struct_subtype (field (mut structref)) data)) + (type $struct (sub (struct (field (mut structref))))) ;; CHECK: (type $child-B (sub $struct (struct (field (mut (ref $struct)))))) ;; CHECK: (type $child-A (sub $struct (struct (field (mut (ref $struct)))))) - (type $child-A (struct_subtype (field (mut structref)) $struct)) + (type $child-A (sub $struct (struct (field (mut structref))))) - (type $child-B (struct_subtype (field (mut structref)) $struct)) + (type $child-B (sub $struct (struct (field (mut structref))))) ) ;; CHECK: (type $3 (func (param (ref $struct) (ref $child-A) (ref $child-B)))) @@ -132,13 +132,13 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field (mut (ref $child-A)))))) - (type $struct (struct_subtype (field (mut structref)) data)) + (type $struct (sub (struct (field (mut structref))))) ;; CHECK: (type $child-A (sub $struct (struct (field (mut (ref $child-A)))))) - (type $child-A (struct_subtype (field (mut structref)) $struct)) + (type $child-A (sub $struct (struct (field (mut structref))))) ;; CHECK: (type $child-B (sub $struct (struct (field (mut (ref $child-A)))))) - (type $child-B (struct_subtype (field (mut structref)) $struct)) + (type $child-B (sub $struct (struct (field (mut structref))))) ) ;; CHECK: (type $3 (func)) @@ -185,10 +185,10 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field (mut (ref $struct)))))) - (type $struct (struct_subtype (field (mut structref)) data)) + (type $struct (sub (struct (field (mut structref))))) ;; CHECK: (type $child (sub $struct (struct (field (mut (ref $struct)))))) - (type $child (struct_subtype (field (mut structref)) $struct)) + (type $child (sub $struct (struct (field (mut structref))))) ;; CHECK: (type $2 (func (param (ref $struct) (ref $child)))) @@ -219,10 +219,10 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field (mut (ref $child)))))) - (type $struct (struct_subtype (field (mut structref)) data)) + (type $struct (sub (struct (field (mut structref))))) ;; CHECK: (type $child (sub $struct (struct (field (mut (ref $child)))))) - (type $child (struct_subtype (field (mut structref)) $struct)) + (type $child (sub $struct (struct (field (mut structref))))) ;; CHECK: (type $2 (func (param (ref $struct) (ref $child)))) @@ -256,10 +256,10 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field (mut (ref $struct)))))) - (type $struct (struct_subtype (field (mut structref)) data)) + (type $struct (sub (struct (field (mut structref))))) ;; CHECK: (type $child (sub $struct (struct (field (mut (ref $struct)))))) - (type $child (struct_subtype (field (mut structref)) $struct)) + (type $child (sub $struct (struct (field (mut structref))))) ;; CHECK: (type $2 (func (param (ref $struct) (ref $child)))) @@ -301,10 +301,10 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field (ref $struct))))) - (type $struct (struct_subtype (field structref) data)) + (type $struct (sub (struct (field structref)))) ;; CHECK: (type $child (sub $struct (struct (field (ref $child))))) - (type $child (struct_subtype (field structref) $struct)) + (type $child (sub $struct (struct (field structref)))) ;; CHECK: (type $2 (func (param (ref $struct) (ref $child)))) @@ -341,10 +341,10 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field (mut (ref $struct)))))) - (type $struct (struct_subtype (field (mut structref)) data)) + (type $struct (sub (struct (field (mut structref))))) ;; CHECK: (type $child (sub $struct (struct (field (mut (ref $struct)))))) - (type $child (struct_subtype (field (mut structref)) $struct)) + (type $child (sub $struct (struct (field (mut structref))))) ;; CHECK: (type $2 (func (param (ref $struct) (ref $child)))) @@ -381,10 +381,10 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field (mut (ref $struct)))))) - (type $struct (struct_subtype (field (mut structref)) data)) + (type $struct (sub (struct (field (mut structref))))) ;; 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)) + (type $child (sub $struct (struct (field (mut structref)) (field (mut structref))))) ;; CHECK: (type $2 (func (param (ref $struct) (ref $child)))) @@ -422,7 +422,7 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field (mut (ref $struct)))))) - (type $struct (struct_subtype (field (mut structref)) data)) + (type $struct (sub (struct (field (mut structref))))) ;; CHECK: (type $1 (func (param (ref $struct)))) @@ -463,14 +463,14 @@ (type $X (sub (struct))) ;; CHECK: (type $Y (sub $X (struct ))) - (type $Y (struct_subtype $X)) + (type $Y (sub $X (struct))) - (type $A (struct_subtype (field (ref $X)) data)) + (type $A (sub (struct (field (ref $X))))) ;; CHECK: (type $C (sub $A (struct (field (ref $Y))))) - (type $C (struct_subtype (field (ref $X)) $A)) + (type $C (sub $A (struct (field (ref $X))))) - (type $B (struct_subtype (field (ref $X)) $A)) + (type $B (sub $A (struct (field (ref $X))))) ) ;; CHECK: (type $5 (func)) @@ -513,16 +513,16 @@ (type $X (sub (struct))) ;; CHECK: (type $Y (sub $X (struct ))) - (type $Y (struct_subtype $X)) + (type $Y (sub $X (struct))) ;; CHECK: (type $A (sub (struct (field (ref $X))))) - (type $A (struct_subtype (field (ref $X)) data)) + (type $A (sub (struct (field (ref $X))))) ;; CHECK: (type $B (sub $A (struct (field (ref $X))))) - (type $B (struct_subtype (field (ref $X)) $A)) + (type $B (sub $A (struct (field (ref $X))))) ;; CHECK: (type $C (sub $A (struct (field (ref $X))))) - (type $C (struct_subtype (field (ref $X)) $A)) + (type $C (sub $A (struct (field (ref $X))))) ) ;; CHECK: (type $5 (func)) @@ -550,12 +550,12 @@ ;; CHECK: (type $A (sub (struct (field (ref $X))))) ;; CHECK: (type $Y (sub $X (struct ))) - (type $Y (struct_subtype $X)) + (type $Y (sub $X (struct))) - (type $A (struct_subtype (field (ref $X)) data)) + (type $A (sub (struct (field (ref $X))))) ;; CHECK: (type $B (sub $A (struct (field (ref $Y))))) - (type $B (struct_subtype (field (ref $Y)) $A)) + (type $B (sub $A (struct (field (ref $Y))))) ;; CHECK: (func $foo (type $1) ;; CHECK-NEXT: (local $unused2 (ref null $B)) @@ -583,7 +583,7 @@ (module ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field (mut (ref null $struct)))))) - (type $struct (struct_subtype (field (mut (ref null struct))) data)) + (type $struct (sub (struct (field (mut (ref null struct)))))) ;; CHECK: (type $1 (func (param (ref $struct)))) @@ -617,9 +617,9 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field (mut (ref null $struct)))))) - (type $struct (struct_subtype (field (mut (ref null struct))) data)) + (type $struct (sub (struct (field (mut (ref null struct)))))) ;; CHECK: (type $child (sub $struct (struct (field (mut (ref null $struct)))))) - (type $child (struct_subtype (field (mut (ref null struct))) $struct)) + (type $child (sub $struct (struct (field (mut (ref null struct)))))) ;; CHECK: (type $2 (func (param (ref $struct) (ref $child)))) @@ -650,9 +650,9 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field (mut (ref null $struct)))))) - (type $struct (struct_subtype (field (mut (ref null struct))) data)) + (type $struct (sub (struct (field (mut (ref null struct)))))) ;; CHECK: (type $child (sub $struct (struct (field (mut (ref null $struct)))))) - (type $child (struct_subtype (field (mut (ref null struct))) $struct)) + (type $child (sub $struct (struct (field (mut (ref null struct)))))) ;; CHECK: (type $2 (func (param (ref $struct) (ref $child)))) @@ -681,7 +681,7 @@ (module ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field (mut nullref))))) - (type $struct (struct_subtype (field (mut (ref null struct))) data)) + (type $struct (sub (struct (field (mut (ref null struct)))))) ;; CHECK: (type $1 (func (param (ref $struct)))) @@ -702,7 +702,7 @@ (module ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field (mut (ref null $struct)))))) - (type $struct (struct_subtype (field (mut (ref null struct))) data)) + (type $struct (sub (struct (field (mut (ref null struct)))))) ;; CHECK: (type $1 (func (param (ref $struct)))) @@ -731,7 +731,7 @@ (module ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct (field (mut (ref null $struct)))))) - (type $struct (struct_subtype (field (mut (ref null struct))) data)) + (type $struct (sub (struct (field (mut (ref null struct)))))) ;; CHECK: (type $1 (func (param (ref $struct)))) @@ -764,10 +764,10 @@ (module ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (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)) + (type $struct (sub (struct (field (mut (ref null struct))) (field (mut (ref null 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)) + (type $child (sub $struct (struct (field (mut (ref null struct))) (field (mut (ref null struct)))))) ;; CHECK: (type $2 (func (param (ref $struct) (ref $child)))) @@ -823,7 +823,7 @@ (type $Root-Inner (sub (struct))) ;; CHECK: (type $Leaf1-Inner (sub $Root-Inner (struct (field i32)))) - (type $Leaf1-Inner (struct_subtype (field i32) $Root-Inner)) + (type $Leaf1-Inner (sub $Root-Inner (struct (field i32)))) ;; CHECK: (type $Root-Outer (sub (struct (field (ref $Leaf2-Inner))))) @@ -832,13 +832,13 @@ ;; CHECK: (type $Leaf2-Outer (sub $Root-Outer (struct (field (ref $Leaf2-Inner))))) ;; CHECK: (type $Leaf2-Inner (sub $Root-Inner (struct ))) - (type $Leaf2-Inner (struct_subtype $Root-Inner)) + (type $Leaf2-Inner (sub $Root-Inner (struct ))) - (type $Root-Outer (struct_subtype (field (ref $Root-Inner)) data)) + (type $Root-Outer (sub (struct (field (ref $Root-Inner))))) - (type $Leaf1-Outer (struct_subtype (field (ref $Leaf1-Inner)) $Root-Outer)) + (type $Leaf1-Outer (sub $Root-Outer (struct (field (ref $Leaf1-Inner))))) - (type $Leaf2-Outer (struct_subtype (field (ref $Leaf2-Inner)) $Root-Outer)) + (type $Leaf2-Outer (sub $Root-Outer (struct (field (ref $Leaf2-Inner))))) ;; CHECK: (type $6 (func (param (ref null $Leaf1-Outer)))) @@ -898,7 +898,7 @@ (module ;; CHECK: (type $A (sub (struct (field (mut (ref null $A)))))) - (type $A (struct_subtype (field (mut (ref null $A))) data)) + (type $A (sub (struct (field (mut (ref null $A)))))) ;; CHECK: (type $1 (func (param (ref $A) (ref null $A)))) @@ -962,9 +962,9 @@ (module ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct (field (ref null $A))))) - (type $A (struct_subtype (field (ref null $A)) data)) + (type $A (sub (struct (field (ref null $A))))) ;; CHECK: (type $B (sub $A (struct (field (ref null $B))))) - (type $B (struct_subtype (field (ref null $A)) $A)) + (type $B (sub $A (struct (field (ref null $A))))) ;; CHECK: (type $2 (func (param (ref null $B) (ref null $A)))) @@ -1013,7 +1013,7 @@ (module ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct (field (mut (ref $A)))))) - (type $A (struct_subtype (field (mut (ref null $A))) data)) + (type $A (sub (struct (field (mut (ref null $A)))))) ;; CHECK: (type $1 (func (param (ref $A) (ref null $A)))) diff --git a/test/lit/passes/type-ssa.wast b/test/lit/passes/type-ssa.wast index ae5b2c532..1c03ecf76 100644 --- a/test/lit/passes/type-ssa.wast +++ b/test/lit/passes/type-ssa.wast @@ -5,7 +5,7 @@ ;; Every struct.new here should get a new type. (module ;; CHECK: (type $struct (sub (struct (field i32)))) - (type $struct (struct_subtype (field i32) data)) + (type $struct (sub (struct (field i32)))) ;; CHECK: (type $1 (func)) @@ -136,7 +136,7 @@ ;; CHECK: (type $0 (func (param anyref arrayref))) ;; CHECK: (type $struct (sub (struct (field anyref)))) - (type $struct (struct_subtype (field (ref null any)) data)) + (type $struct (sub (struct (field (ref null any))))) ;; CHECK: (rec ;; CHECK-NEXT: (type $struct$1 (sub $struct (struct (field anyref)))) @@ -423,7 +423,7 @@ (type $array (sub (array (mut f32)))) ;; CHECK: (type $subarray (sub $array (array (mut f32)))) - (type $subarray (array_subtype (mut f32) $array)) + (type $subarray (sub $array (array (mut f32)))) ;; CHECK: (type $2 (func (param (ref $subarray)))) diff --git a/test/lit/passes/type-ssa_and_merging.wast b/test/lit/passes/type-ssa_and_merging.wast index 46129e37f..d1e3a53fa 100644 --- a/test/lit/passes/type-ssa_and_merging.wast +++ b/test/lit/passes/type-ssa_and_merging.wast @@ -17,7 +17,7 @@ ;; YES-NEXT: (type $1 (func (param (ref $A)))) ;; YES: (type $A (sub (struct ))) - (type $A (struct_subtype (field (mut i32)) data)) + (type $A (sub (struct (field (mut i32))))) ;; NOP: (type $2 (func (result i32))) diff --git a/test/lit/recursive-types.wast b/test/lit/recursive-types.wast index 46b6d3c10..4e92c8e6f 100644 --- a/test/lit/recursive-types.wast +++ b/test/lit/recursive-types.wast @@ -13,7 +13,7 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $f3 (sub (func (param (ref null $type$2)) (result (ref null $f3))))) (type $f3 (sub (func (param (ref null 4)) (result (ref null 3))))) - (type (func_subtype (param (ref null 3)) (result (ref null 4)) $f3)) + (type (sub $f3 (func (param (ref null 3)) (result (ref null 4))))) ) ;; CHECK: (type $type$2 (sub $f3 (func (param (ref null $f3)) (result (ref null $type$2))))) diff --git a/test/lit/strings.wast b/test/lit/strings.wast index fb86c484d..f4b965c0b 100644 --- a/test/lit/strings.wast +++ b/test/lit/strings.wast @@ -21,9 +21,9 @@ ;; CHECK: (type $2 (func (param stringref stringview_wtf8 stringview_wtf16 stringview_iter))) ;; CHECK: (type $array (sub (array (mut i8)))) - (type $array (array_subtype (mut i8) data)) + (type $array (sub (array (mut i8)))) ;; CHECK: (type $array16 (sub (array (mut i16)))) - (type $array16 (array_subtype (mut i16) data)) + (type $array16 (sub (array (mut i16)))) ;; CHECK: (type $5 (func (param stringref stringview_wtf8 stringview_wtf16 stringview_iter stringref stringview_wtf8 stringview_wtf16 stringview_iter (ref string) (ref stringview_wtf8) (ref stringview_wtf16) (ref stringview_iter)))) diff --git a/test/lit/subtype-chain.wast b/test/lit/subtype-chain.wast index 882aadae6..f0b774fab 100644 --- a/test/lit/subtype-chain.wast +++ b/test/lit/subtype-chain.wast @@ -11,16 +11,16 @@ (type $root (sub (struct))) ;; CHECK: (type $trunk (sub $root (struct (field i32)))) - (type $trunk (struct_subtype i32 $root)) + (type $trunk (sub $root (struct i32))) ;; CHECK: (type $branch (sub $trunk (struct (field i32) (field i64)))) - (type $branch (struct_subtype i32 i64 $trunk)) + (type $branch (sub $trunk (struct i32 i64))) ;; CHECK: (type $twig (sub $branch (struct (field i32) (field i64) (field f32)))) - (type $twig (struct_subtype i32 i64 f32 $branch)) + (type $twig (sub $branch (struct i32 i64 f32))) ;; CHECK: (type $leaf (sub $twig (struct (field i32) (field i64) (field f32) (field f64)))) - (type $leaf (struct_subtype i32 i64 f32 f64 $twig)) + (type $leaf (sub $twig (struct i32 i64 f32 f64))) ;; CHECK: (func $make-root (type $5) (param $leaf (ref $leaf)) (result (ref null $root)) ;; CHECK-NEXT: (local.get $leaf) diff --git a/test/lit/subtypes.wast b/test/lit/subtypes.wast index 20f605b5f..628246934 100644 --- a/test/lit/subtypes.wast +++ b/test/lit/subtypes.wast @@ -9,7 +9,7 @@ ;; CHECK-NEXT: (type $super-struct (sub (struct (field i32)))) (type $super-struct (sub (struct i32))) ;; CHECK: (type $sub-struct (sub $super-struct (struct (field i32) (field i64)))) - (type $sub-struct (struct_subtype i32 i64 $super-struct)) + (type $sub-struct (sub $super-struct (struct i32 i64))) ) (rec @@ -17,7 +17,7 @@ ;; CHECK-NEXT: (type $super-array (sub (array (ref $super-struct)))) (type $super-array (sub (array (ref $super-struct)))) ;; CHECK: (type $sub-array (sub $super-array (array (ref $sub-struct)))) - (type $sub-array (array_subtype (ref $sub-struct) $super-array)) + (type $sub-array (sub $super-array (array (ref $sub-struct)))) ) (rec @@ -25,7 +25,7 @@ ;; CHECK-NEXT: (type $super-func (sub (func (param (ref $sub-array)) (result (ref $super-array))))) (type $super-func (sub (func (param (ref $sub-array)) (result (ref $super-array))))) ;; 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)) + (type $sub-func (sub $super-func (func (param (ref $super-array)) (result (ref $sub-array))))) ) ;; CHECK: (func $make-super-struct (type $4) (result (ref $super-struct)) diff --git a/test/lit/tail-call.wast b/test/lit/tail-call.wast index 873d79034..2830b08da 100644 --- a/test/lit/tail-call.wast +++ b/test/lit/tail-call.wast @@ -37,7 +37,7 @@ (type $A (sub (struct i32))) ;; CHECK: (type $B (sub $A (struct (field i32) (field i32)))) - (type $B (struct_subtype i32 i32 $A)) + (type $B (sub $A (struct i32 i32))) ;; CHECK: (type $return-B (func (result (ref $B)))) (type $return-B (func (result (ref $B)))) diff --git a/test/lit/validation/supertypes-no-gc.wast b/test/lit/validation/supertypes-no-gc.wast index eeacccfaf..786289c00 100644 --- a/test/lit/validation/supertypes-no-gc.wast +++ b/test/lit/validation/supertypes-no-gc.wast @@ -5,8 +5,8 @@ ;; CHECK: all used types should be allowed (module - (type $f1 (func_subtype func)) - (type $f2 (func_subtype $f1)) + (type $f1 (sub (func))) + (type $f2 (sub $f1 (func))) (func $test (type $f2) (unreachable) diff --git a/test/passes/Oz_fuzz-exec_all-features.wast b/test/passes/Oz_fuzz-exec_all-features.wast index cc6ebb46e..4c38c315d 100644 --- a/test/passes/Oz_fuzz-exec_all-features.wast +++ b/test/passes/Oz_fuzz-exec_all-features.wast @@ -1,6 +1,6 @@ (module (type $struct (sub (struct (mut i32)))) - (type $extendedstruct (struct_subtype (mut i32) f64 $struct)) + (type $extendedstruct (sub $struct (struct (mut i32) f64))) (type $bytes (array (mut i8))) (type $void_func (func)) diff --git a/test/spec/ref_cast.wast b/test/spec/ref_cast.wast index 1a09a68f3..e1113fac0 100644 --- a/test/spec/ref_cast.wast +++ b/test/spec/ref_cast.wast @@ -1,10 +1,10 @@ (module (type $t0 (sub (struct))) - (type $t1 (struct_subtype (field i32) $t0)) - (type $t1' (struct_subtype (field i32) $t1)) - (type $t2 (struct_subtype (field i32) (field i32) $t1)) - (type $t2' (struct_subtype (field i32) (field i32) $t2)) - (type $t3 (struct_subtype (field i32) (field i32) $t2)) + (type $t1 (sub $t0 (struct (field i32)))) + (type $t1' (sub $t1 (struct (field i32)))) + (type $t2 (sub $t1 (struct (field i32) (field i32)))) + (type $t2' (sub $t2 (struct (field i32) (field i32)))) + (type $t3 (sub $t2 (struct (field i32) (field i32)))) (global $tab.0 (mut (ref null struct)) (ref.null struct)) (global $tab.1 (mut (ref null struct)) (ref.null struct)) diff --git a/test/spec/ref_test.wast b/test/spec/ref_test.wast index f30e27b6b..13bc34878 100644 --- a/test/spec/ref_test.wast +++ b/test/spec/ref_test.wast @@ -180,14 +180,14 @@ ;; Concrete Types (module - (type $t0 (struct_subtype data)) - (type $t1 (struct_subtype i32 $t0)) - (type $t1' (struct_subtype i32 $t0)) - (type $t2 (struct_subtype i32 i32 $t1)) - (type $t2' (struct_subtype i32 i32 $t1')) - (type $t3 (struct_subtype i32 i32 $t0)) - (type $t0' (struct_subtype $t0)) - (type $t4 (struct_subtype i32 i32 $t0')) + (type $t0 (sub (struct))) + (type $t1 (sub $t0 (struct i32))) + (type $t1' (sub $t0 (struct i32))) + (type $t2 (sub $t1 (struct i32 i32))) + (type $t2' (sub $t1' (struct i32 i32))) + (type $t3 (sub $t0 (struct i32 i32))) + (type $t0' (sub $t0 (struct))) + (type $t4 (sub $t0' (struct i32 i32))) (table $tab 20 (ref null struct)) diff --git a/test/subtypes.wast b/test/subtypes.wast index 0076f7eb3..08059e723 100644 --- a/test/subtypes.wast +++ b/test/subtypes.wast @@ -4,31 +4,28 @@ (type $vector-i32 (array i32)) (type $vector-any (sub (array (ref any)))) - (type $vector-i31 (array_subtype (ref i31) $vector-any)) + (type $vector-i31 (sub $vector-any (array (ref i31)))) ;; Structs (type $struct-any (sub (struct (field (ref any)) ))) - (type $struct-i31 (struct_subtype + (type $struct-i31 (sub $struct-any (struct (field (ref i31)) - $struct-any - )) - (type $struct-i31_any (struct_subtype + ))) + (type $struct-i31_any (sub $struct-i31(struct (field (ref i31)) (field (ref any)) - $struct-i31 - )) + ))) ;; Recursive structs (type $struct-rec-one (sub (struct (field (ref $struct-rec-one)) ))) - (type $struct-rec-two (struct_subtype + (type $struct-rec-two (sub $struct-rec-one (struct (field (ref $struct-rec-two)) (field (ref $struct-rec-two)) - $struct-rec-one - )) + ))) (func $foo (param $no-null (ref $vector-i32)) (param $yes-null (ref null $vector-i32)) |