diff --git a/src/parser/parsers.h b/src/parser/parsers.h index 7188d8aad20..3733761bc2c 100644 --- a/src/parser/parsers.h +++ b/src/parser/parsers.h @@ -3091,34 +3091,30 @@ template Result<> comptype(Ctx& ctx) { return ctx.in.err("expected type description"); } -// describedcomptype ::= '(' 'descriptor' typeidx ct:comptype ')' -// | ct:comptype +// describedcomptype ::= '(' 'descriptor' typeidx ')' comptype +// | comptype template Result<> describedcomptype(Ctx& ctx) { if (ctx.in.takeSExprStart("descriptor"sv)) { - auto x = typeidx(ctx); - CHECK_ERR(x); - ctx.setDescriptor(*x); - CHECK_ERR(comptype(ctx)); + auto d = typeidx(ctx); + CHECK_ERR(d); if (!ctx.in.takeRParen()) { - return ctx.in.err("expected end of described type"); + return ctx.in.err("expected end of descriptor"); } - return Ok{}; + ctx.setDescriptor(*d); } return comptype(ctx); } -// describingcomptype ::= '(' 'describes' typeidx ct:describedcomptype ')' -// | ct: describedcomptype +// describingcomptype ::= '(' 'describes' typeidx ')' describedcomptype +// | describedcomptype template Result<> describingcomptype(Ctx& ctx) { if (ctx.in.takeSExprStart("describes"sv)) { - auto x = typeidx(ctx); - CHECK_ERR(x); - ctx.setDescribes(*x); - CHECK_ERR(describedcomptype(ctx)); + auto d = typeidx(ctx); + CHECK_ERR(d); if (!ctx.in.takeRParen()) { - return ctx.in.err("expected end of describing type"); + return ctx.in.err("expected end of describes"); } - return Ok{}; + ctx.setDescribes(*d); } return describedcomptype(ctx); } diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp index 097f3b2284f..265d4ac5b50 100644 --- a/src/wasm/wasm-type.cpp +++ b/src/wasm/wasm-type.cpp @@ -1823,12 +1823,12 @@ std::ostream& TypePrinter::print(HeapType type) { if (auto desc = type.getDescribedType()) { os << "(describes "; printHeapTypeName(*desc); - os << ' '; + os << ") "; } if (auto desc = type.getDescriptorType()) { os << "(descriptor "; printHeapTypeName(*desc); - os << ' '; + os << ") "; } switch (type.getKind()) { case HeapTypeKind::Func: @@ -1846,12 +1846,6 @@ std::ostream& TypePrinter::print(HeapType type) { case HeapTypeKind::Basic: WASM_UNREACHABLE("unexpected kind"); } - if (type.getDescriptorType()) { - os << ')'; - } - if (type.getDescribedType()) { - os << ')'; - } if (type.isShared()) { os << ')'; } diff --git a/test/lit/basic/custom-descriptors.wast b/test/lit/basic/custom-descriptors.wast index 8e0892f2d40..cf2400f82d8 100644 --- a/test/lit/basic/custom-descriptors.wast +++ b/test/lit/basic/custom-descriptors.wast @@ -12,31 +12,31 @@ (module (rec ;; CHECK-TEXT: (rec - ;; CHECK-TEXT-NEXT: (type $described (descriptor $middle (struct))) + ;; CHECK-TEXT-NEXT: (type $described (descriptor $middle) (struct)) ;; CHECK-BIN: (rec - ;; CHECK-BIN-NEXT: (type $described (descriptor $middle (struct))) - (type $described (descriptor $middle (struct))) - ;; CHECK-TEXT: (type $middle (describes $described (descriptor $describing (struct)))) - ;; CHECK-BIN: (type $middle (describes $described (descriptor $describing (struct)))) - (type $middle (describes $described (descriptor $describing (struct)))) - ;; CHECK-TEXT: (type $describing (describes $middle (struct))) - ;; CHECK-BIN: (type $describing (describes $middle (struct))) - (type $describing (describes $middle (struct))) + ;; CHECK-BIN-NEXT: (type $described (descriptor $middle) (struct)) + (type $described (descriptor $middle) (struct)) + ;; CHECK-TEXT: (type $middle (describes $described) (descriptor $describing) (struct)) + ;; CHECK-BIN: (type $middle (describes $described) (descriptor $describing) (struct)) + (type $middle (describes $described) (descriptor $describing) (struct)) + ;; CHECK-TEXT: (type $describing (describes $middle) (struct)) + ;; CHECK-BIN: (type $describing (describes $middle) (struct)) + (type $describing (describes $middle) (struct)) ) (rec ;; CHECK-TEXT: (type $3 (func (param anyref) (result anyref))) ;; CHECK-TEXT: (rec - ;; CHECK-TEXT-NEXT: (type $pair (descriptor $pair.desc (struct (field i32) (field i64)))) + ;; CHECK-TEXT-NEXT: (type $pair (descriptor $pair.desc) (struct (field i32) (field i64))) ;; CHECK-BIN: (type $3 (func (param anyref) (result anyref))) ;; CHECK-BIN: (rec - ;; CHECK-BIN-NEXT: (type $pair (descriptor $pair.desc (struct (field i32) (field i64)))) - (type $pair (descriptor $pair.desc (struct (field i32 i64)))) - ;; CHECK-TEXT: (type $pair.desc (describes $pair (struct))) - ;; CHECK-BIN: (type $pair.desc (describes $pair (struct))) - (type $pair.desc (describes $pair (struct))) + ;; CHECK-BIN-NEXT: (type $pair (descriptor $pair.desc) (struct (field i32) (field i64))) + (type $pair (descriptor $pair.desc) (struct (field i32 i64))) + ;; CHECK-TEXT: (type $pair.desc (describes $pair) (struct)) + ;; CHECK-BIN: (type $pair.desc (describes $pair) (struct)) + (type $pair.desc (describes $pair) (struct)) ) (rec @@ -58,7 +58,7 @@ ;; CHECK-TEXT: (type $13 (func (result (ref (exact $pair))))) ;; CHECK-TEXT: (rec - ;; CHECK-TEXT-NEXT: (type $shared-described (shared (descriptor $shared-describing (struct)))) + ;; CHECK-TEXT-NEXT: (type $shared-described (shared (descriptor $shared-describing) (struct))) ;; CHECK-BIN: (type $6 (func)) ;; CHECK-BIN: (type $7 (func (param anyref (ref null $describing)))) @@ -76,11 +76,11 @@ ;; CHECK-BIN: (type $13 (func (result (ref (exact $pair))))) ;; CHECK-BIN: (rec - ;; CHECK-BIN-NEXT: (type $shared-described (shared (descriptor $shared-describing (struct)))) - (type $shared-described (shared (descriptor $shared-describing (struct)))) - ;; CHECK-TEXT: (type $shared-describing (shared (describes $shared-described (struct)))) - ;; CHECK-BIN: (type $shared-describing (shared (describes $shared-described (struct)))) - (type $shared-describing (shared (describes $shared-described (struct)))) + ;; CHECK-BIN-NEXT: (type $shared-described (shared (descriptor $shared-describing) (struct))) + (type $shared-described (shared (descriptor $shared-describing) (struct))) + ;; CHECK-TEXT: (type $shared-describing (shared (describes $shared-described) (struct))) + ;; CHECK-BIN: (type $shared-describing (shared (describes $shared-described) (struct))) + (type $shared-describing (shared (describes $shared-described) (struct))) ) @@ -685,18 +685,18 @@ ) ;; CHECK-BIN-NODEBUG: (rec -;; CHECK-BIN-NODEBUG-NEXT: (type $0 (descriptor $1 (struct))) +;; CHECK-BIN-NODEBUG-NEXT: (type $0 (descriptor $1) (struct)) -;; CHECK-BIN-NODEBUG: (type $1 (describes $0 (descriptor $2 (struct)))) +;; CHECK-BIN-NODEBUG: (type $1 (describes $0) (descriptor $2) (struct)) -;; CHECK-BIN-NODEBUG: (type $2 (describes $1 (struct))) +;; CHECK-BIN-NODEBUG: (type $2 (describes $1) (struct)) ;; CHECK-BIN-NODEBUG: (type $3 (func (param anyref) (result anyref))) ;; CHECK-BIN-NODEBUG: (rec -;; CHECK-BIN-NODEBUG-NEXT: (type $4 (descriptor $5 (struct (field i32) (field i64)))) +;; CHECK-BIN-NODEBUG-NEXT: (type $4 (descriptor $5) (struct (field i32) (field i64))) -;; CHECK-BIN-NODEBUG: (type $5 (describes $4 (struct))) +;; CHECK-BIN-NODEBUG: (type $5 (describes $4) (struct)) ;; CHECK-BIN-NODEBUG: (type $6 (func)) @@ -715,9 +715,9 @@ ;; CHECK-BIN-NODEBUG: (type $13 (func (result (ref (exact $4))))) ;; CHECK-BIN-NODEBUG: (rec -;; CHECK-BIN-NODEBUG-NEXT: (type $14 (shared (descriptor $15 (struct)))) +;; CHECK-BIN-NODEBUG-NEXT: (type $14 (shared (descriptor $15) (struct))) -;; CHECK-BIN-NODEBUG: (type $15 (shared (describes $14 (struct)))) +;; CHECK-BIN-NODEBUG: (type $15 (shared (describes $14) (struct))) ;; CHECK-BIN-NODEBUG: (type $16 (func (param (ref null $0) (ref null (exact $1))))) diff --git a/test/lit/ctor-eval/gc-desc.wast b/test/lit/ctor-eval/gc-desc.wast index ff35e70e071..fe992d7ed89 100644 --- a/test/lit/ctor-eval/gc-desc.wast +++ b/test/lit/ctor-eval/gc-desc.wast @@ -4,10 +4,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (sub (descriptor $desc (struct)))) - (type $struct (sub (descriptor $desc (struct)))) - ;; CHECK: (type $desc (describes $struct (struct))) - (type $desc (describes $struct (struct))) + ;; CHECK-NEXT: (type $struct (sub (descriptor $desc) (struct))) + (type $struct (sub (descriptor $desc) (struct))) + ;; CHECK: (type $desc (describes $struct) (struct)) + (type $desc (describes $struct) (struct)) ) ;; CHECK: (type $2 (func)) diff --git a/test/lit/fuzz-types.test b/test/lit/fuzz-types.test index 2e6959df680..840fc1bb36b 100644 --- a/test/lit/fuzz-types.test +++ b/test/lit/fuzz-types.test @@ -10,12 +10,12 @@ ;; CHECK-NEXT: (type $4 (sub (array (ref null $9)))) ;; CHECK-NEXT: (type $5 (sub final $0 (shared (array i8)))) ;; CHECK-NEXT: (type $6 (sub $2 (shared (func (param i64 (ref null (shared eq)) i64) (result (ref $8)))))) -;; CHECK-NEXT: (type $7 (sub (shared (descriptor $9 (struct (field (ref null $7)) (field (mut i64)) (field (mut i8)) (field i32) (field (mut i32))))))) +;; CHECK-NEXT: (type $7 (sub (shared (descriptor $9) (struct (field (ref null $7)) (field (mut i64)) (field (mut i8)) (field i32) (field (mut i32)))))) ;; CHECK-NEXT: (type $8 (sub $2 (shared (func (param i64 (ref null $0) i64) (result (ref $8)))))) -;; CHECK-NEXT: (type $9 (shared (describes $7 (descriptor $12 (struct (field i32) (field (mut (ref $8))) (field f64)))))) +;; CHECK-NEXT: (type $9 (shared (describes $7) (descriptor $12) (struct (field i32) (field (mut (ref $8))) (field f64)))) ;; CHECK-NEXT: (type $10 (sub (array (mut externref)))) ;; CHECK-NEXT: (type $11 (sub $4 (array (ref $9)))) -;; CHECK-NEXT: (type $12 (sub (shared (describes $9 (struct (field (mut f64)) (field (mut i32)) (field (mut f64))))))) +;; CHECK-NEXT: (type $12 (sub (shared (describes $9) (struct (field (mut f64)) (field (mut i32)) (field (mut f64)))))) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (rec ;; CHECK-NEXT: (type $13 (sub (struct (field (mut i16)) (field i64) (field (mut (ref (shared func))))))) @@ -42,12 +42,12 @@ ;; CHECK-NEXT: (type $4 (sub (array (ref null $9)))) ;; CHECK-NEXT: (type $5 (sub final $0 (shared (array i8)))) ;; CHECK-NEXT: (type $6 (sub $2 (shared (func (param i64 (ref null (shared eq)) i64) (result (ref $8)))))) -;; CHECK-NEXT: (type $7 (sub (shared (descriptor $9 (struct (field (ref null $7)) (field (mut i64)) (field (mut i8)) (field i32) (field (mut i32))))))) +;; CHECK-NEXT: (type $7 (sub (shared (descriptor $9) (struct (field (ref null $7)) (field (mut i64)) (field (mut i8)) (field i32) (field (mut i32)))))) ;; CHECK-NEXT: (type $8 (sub $2 (shared (func (param i64 (ref null $0) i64) (result (ref $8)))))) -;; CHECK-NEXT: (type $9 (shared (describes $7 (descriptor $12 (struct (field i32) (field (mut (ref $8))) (field f64)))))) +;; CHECK-NEXT: (type $9 (shared (describes $7) (descriptor $12) (struct (field i32) (field (mut (ref $8))) (field f64)))) ;; CHECK-NEXT: (type $10 (sub (array (mut externref)))) ;; CHECK-NEXT: (type $11 (sub $4 (array (ref $9)))) -;; CHECK-NEXT: (type $12 (sub (shared (describes $9 (struct (field (mut f64)) (field (mut i32)) (field (mut f64))))))) +;; CHECK-NEXT: (type $12 (sub (shared (describes $9) (struct (field (mut f64)) (field (mut i32)) (field (mut f64)))))) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (rec ;; CHECK-NEXT: (type $13 (sub (struct (field (mut i16)) (field i64) (field (mut (ref (shared func))))))) diff --git a/test/lit/passes/abstract-type-refining-desc.wast b/test/lit/passes/abstract-type-refining-desc.wast index 8b8e082c234..c7864fd458b 100644 --- a/test/lit/passes/abstract-type-refining-desc.wast +++ b/test/lit/passes/abstract-type-refining-desc.wast @@ -12,19 +12,19 @@ ;; relation between $B.desc and $A.desc. (rec ;; YESTNH: (rec - ;; YESTNH-NEXT: (type $A (sub (descriptor $A.desc (struct)))) + ;; YESTNH-NEXT: (type $A (sub (descriptor $A.desc) (struct))) ;; NO_TNH: (rec - ;; NO_TNH-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; YESTNH: (type $A.desc (sub (describes $A (struct)))) - ;; NO_TNH: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) - ;; YESTNH: (type $B (sub $A (descriptor $B.desc (struct)))) - ;; NO_TNH: (type $B (sub $A (descriptor $B.desc (struct)))) - (type $B (sub $A (descriptor $B.desc (struct)))) - ;; YESTNH: (type $B.desc (sub $A.desc (describes $B (struct)))) - ;; NO_TNH: (type $B.desc (sub $A.desc (describes $B (struct)))) - (type $B.desc (sub $A.desc (describes $B (struct)))) + ;; NO_TNH-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; YESTNH: (type $A.desc (sub (describes $A) (struct))) + ;; NO_TNH: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) + ;; YESTNH: (type $B (sub $A (descriptor $B.desc) (struct))) + ;; NO_TNH: (type $B (sub $A (descriptor $B.desc) (struct))) + (type $B (sub $A (descriptor $B.desc) (struct))) + ;; YESTNH: (type $B.desc (sub $A.desc (describes $B) (struct))) + ;; NO_TNH: (type $B.desc (sub $A.desc (describes $B) (struct))) + (type $B.desc (sub $A.desc (describes $B) (struct))) ) ;; YESTNH: (global $g (ref (exact $B)) (struct.new_default $B ;; YESTNH-NEXT: (ref.null none) @@ -45,19 +45,19 @@ ;; optimized to $B with TNH. (rec ;; YESTNH: (rec - ;; YESTNH-NEXT: (type $A (sub (descriptor $A.desc (struct (field (ref null $B)) (field (ref null $B)))))) + ;; YESTNH-NEXT: (type $A (sub (descriptor $A.desc) (struct (field (ref null $B)) (field (ref null $B))))) ;; NO_TNH: (rec - ;; NO_TNH-NEXT: (type $A (sub (descriptor $A.desc (struct (field (ref null $A)) (field (ref null $B)))))) - (type $A (sub (descriptor $A.desc (struct (field (ref null $A) (ref null $B)))))) - ;; YESTNH: (type $A.desc (sub (describes $A (struct (field nullref) (field nullref))))) - ;; NO_TNH: (type $A.desc (sub (describes $A (struct (field nullref) (field nullref))))) - (type $A.desc (sub (describes $A (struct (field (ref null $A.desc) (ref null $B.desc)))))) - ;; YESTNH: (type $B (sub $A (descriptor $B.desc (struct (field (ref null $B)) (field (ref null $B)))))) - ;; NO_TNH: (type $B (sub $A (descriptor $B.desc (struct (field (ref null $A)) (field (ref null $B)))))) - (type $B (sub $A (descriptor $B.desc (struct (field (ref null $A) (ref null $B)))))) - ;; YESTNH: (type $B.desc (sub $A.desc (describes $B (struct (field nullref) (field nullref))))) - ;; NO_TNH: (type $B.desc (sub $A.desc (describes $B (struct (field nullref) (field nullref))))) - (type $B.desc (sub $A.desc (describes $B (struct (field (ref null $A.desc) (ref null $B.desc)))))) + ;; NO_TNH-NEXT: (type $A (sub (descriptor $A.desc) (struct (field (ref null $A)) (field (ref null $B))))) + (type $A (sub (descriptor $A.desc) (struct (field (ref null $A) (ref null $B))))) + ;; YESTNH: (type $A.desc (sub (describes $A) (struct (field nullref) (field nullref)))) + ;; NO_TNH: (type $A.desc (sub (describes $A) (struct (field nullref) (field nullref)))) + (type $A.desc (sub (describes $A) (struct (field (ref null $A.desc) (ref null $B.desc))))) + ;; YESTNH: (type $B (sub $A (descriptor $B.desc) (struct (field (ref null $B)) (field (ref null $B))))) + ;; NO_TNH: (type $B (sub $A (descriptor $B.desc) (struct (field (ref null $A)) (field (ref null $B))))) + (type $B (sub $A (descriptor $B.desc) (struct (field (ref null $A) (ref null $B))))) + ;; YESTNH: (type $B.desc (sub $A.desc (describes $B) (struct (field nullref) (field nullref)))) + ;; NO_TNH: (type $B.desc (sub $A.desc (describes $B) (struct (field nullref) (field nullref)))) + (type $B.desc (sub $A.desc (describes $B) (struct (field (ref null $A.desc) (ref null $B.desc))))) ) ;; YESTNH: (global $g (ref (exact $B)) (struct.new_default $B @@ -76,13 +76,13 @@ (module (rec ;; YESTNH: (rec - ;; YESTNH-NEXT: (type $struct (descriptor $desc (struct))) + ;; YESTNH-NEXT: (type $struct (descriptor $desc) (struct)) ;; NO_TNH: (rec - ;; NO_TNH-NEXT: (type $struct (descriptor $desc (struct))) - (type $struct (descriptor $desc (struct))) - ;; YESTNH: (type $desc (describes $struct (struct))) - ;; NO_TNH: (type $desc (describes $struct (struct))) - (type $desc (describes $struct (struct))) + ;; NO_TNH-NEXT: (type $struct (descriptor $desc) (struct)) + (type $struct (descriptor $desc) (struct)) + ;; YESTNH: (type $desc (describes $struct) (struct)) + ;; NO_TNH: (type $desc (describes $struct) (struct)) + (type $desc (describes $struct) (struct)) ) ;; YESTNH: (type $2 (func (param anyref (ref null $desc)) (result nullref))) @@ -850,19 +850,19 @@ ;; invalid allocations of its described type. (rec ;; YESTNH: (rec - ;; YESTNH-NEXT: (type $struct (sub (descriptor $uninstantiated (struct)))) + ;; YESTNH-NEXT: (type $struct (sub (descriptor $uninstantiated) (struct))) ;; NO_TNH: (rec - ;; NO_TNH-NEXT: (type $struct (sub (descriptor $uninstantiated (struct)))) - (type $struct (sub (descriptor $uninstantiated (struct)))) - ;; YESTNH: (type $uninstantiated (sub (describes $struct (struct)))) - ;; NO_TNH: (type $uninstantiated (sub (describes $struct (struct)))) - (type $uninstantiated (sub (describes $struct (struct)))) - ;; YESTNH: (type $sub (sub $struct (descriptor $instantiated (struct)))) - ;; NO_TNH: (type $sub (sub $struct (descriptor $instantiated (struct)))) - (type $sub (sub $struct (descriptor $instantiated (struct)))) - ;; YESTNH: (type $instantiated (sub $uninstantiated (describes $sub (struct)))) - ;; NO_TNH: (type $instantiated (sub $uninstantiated (describes $sub (struct)))) - (type $instantiated (sub $uninstantiated (describes $sub (struct)))) + ;; NO_TNH-NEXT: (type $struct (sub (descriptor $uninstantiated) (struct))) + (type $struct (sub (descriptor $uninstantiated) (struct))) + ;; YESTNH: (type $uninstantiated (sub (describes $struct) (struct))) + ;; NO_TNH: (type $uninstantiated (sub (describes $struct) (struct))) + (type $uninstantiated (sub (describes $struct) (struct))) + ;; YESTNH: (type $sub (sub $struct (descriptor $instantiated) (struct))) + ;; NO_TNH: (type $sub (sub $struct (descriptor $instantiated) (struct))) + (type $sub (sub $struct (descriptor $instantiated) (struct))) + ;; YESTNH: (type $instantiated (sub $uninstantiated (describes $sub) (struct))) + ;; NO_TNH: (type $instantiated (sub $uninstantiated (describes $sub) (struct))) + (type $instantiated (sub $uninstantiated (describes $sub) (struct))) ) ;; YESTNH: (type $4 (func (result (ref $struct)))) @@ -944,13 +944,13 @@ ;; we can. (rec ;; YESTNH: (rec - ;; YESTNH-NEXT: (type $struct (descriptor $uninstantiated (struct))) + ;; YESTNH-NEXT: (type $struct (descriptor $uninstantiated) (struct)) ;; NO_TNH: (rec - ;; NO_TNH-NEXT: (type $struct (descriptor $uninstantiated (struct))) - (type $struct (descriptor $uninstantiated (struct))) - ;; YESTNH: (type $uninstantiated (describes $struct (struct))) - ;; NO_TNH: (type $uninstantiated (describes $struct (struct))) - (type $uninstantiated (describes $struct (struct))) + ;; NO_TNH-NEXT: (type $struct (descriptor $uninstantiated) (struct)) + (type $struct (descriptor $uninstantiated) (struct)) + ;; YESTNH: (type $uninstantiated (describes $struct) (struct)) + ;; NO_TNH: (type $uninstantiated (describes $struct) (struct)) + (type $uninstantiated (describes $struct) (struct)) ) ;; YESTNH: (type $2 (func (result (ref $struct)))) @@ -1027,13 +1027,13 @@ ;; validating type for the new result; and it traps anyhow). (rec ;; YESTNH: (rec - ;; YESTNH-NEXT: (type $A (sub (descriptor $B (struct)))) + ;; YESTNH-NEXT: (type $A (sub (descriptor $B) (struct))) ;; NO_TNH: (rec - ;; NO_TNH-NEXT: (type $A (sub (descriptor $B (struct)))) - (type $A (sub (descriptor $B (struct)))) - ;; YESTNH: (type $B (describes $A (struct))) - ;; NO_TNH: (type $B (describes $A (struct))) - (type $B (describes $A (struct))) + ;; NO_TNH-NEXT: (type $A (sub (descriptor $B) (struct))) + (type $A (sub (descriptor $B) (struct))) + ;; YESTNH: (type $B (describes $A) (struct)) + ;; NO_TNH: (type $B (describes $A) (struct)) + (type $B (describes $A) (struct)) ) ;; YESTNH: (type $2 (func (result (ref none)))) @@ -1093,20 +1093,20 @@ ;; As above, but now there are subtypes $A.sub, $B.sub. (rec ;; YESTNH: (rec - ;; YESTNH-NEXT: (type $A (sub (descriptor $B (struct)))) + ;; YESTNH-NEXT: (type $A (sub (descriptor $B) (struct))) ;; NO_TNH: (rec - ;; NO_TNH-NEXT: (type $A (sub (descriptor $B (struct)))) - (type $A (sub (descriptor $B (struct)))) - ;; YESTNH: (type $B (sub (describes $A (struct)))) - ;; NO_TNH: (type $B (sub (describes $A (struct)))) - (type $B (sub (describes $A (struct)))) - - ;; YESTNH: (type $A.sub (sub $A (descriptor $B.sub (struct)))) - ;; NO_TNH: (type $A.sub (sub $A (descriptor $B.sub (struct)))) - (type $A.sub (sub $A (descriptor $B.sub (struct)))) - ;; YESTNH: (type $B.sub (sub $B (describes $A.sub (struct)))) - ;; NO_TNH: (type $B.sub (sub $B (describes $A.sub (struct)))) - (type $B.sub (sub $B (describes $A.sub (struct)))) + ;; NO_TNH-NEXT: (type $A (sub (descriptor $B) (struct))) + (type $A (sub (descriptor $B) (struct))) + ;; YESTNH: (type $B (sub (describes $A) (struct))) + ;; NO_TNH: (type $B (sub (describes $A) (struct))) + (type $B (sub (describes $A) (struct))) + + ;; YESTNH: (type $A.sub (sub $A (descriptor $B.sub) (struct))) + ;; NO_TNH: (type $A.sub (sub $A (descriptor $B.sub) (struct))) + (type $A.sub (sub $A (descriptor $B.sub) (struct))) + ;; YESTNH: (type $B.sub (sub $B (describes $A.sub) (struct))) + ;; NO_TNH: (type $B.sub (sub $B (describes $A.sub) (struct))) + (type $B.sub (sub $B (describes $A.sub) (struct))) ) ;; YESTNH: (type $4 (func)) @@ -1192,9 +1192,9 @@ ;; Shared abstract described types. (module (rec - (type $A (sub (shared (descriptor $B (struct))))) - (type $B (sub (shared (describes $A (descriptor $C (struct)))))) - (type $C (sub (shared (describes $B (struct))))) + (type $A (sub (shared (descriptor $B) (struct)))) + (type $B (sub (shared (describes $A) (descriptor $C) (struct)))) + (type $C (sub (shared (describes $B) (struct)))) ) ;; YESTNH: (rec diff --git a/test/lit/passes/abstract-type-refining-tnh-exact-casts.wast b/test/lit/passes/abstract-type-refining-tnh-exact-casts.wast index 8de343d4e7c..3e993adb1f6 100644 --- a/test/lit/passes/abstract-type-refining-tnh-exact-casts.wast +++ b/test/lit/passes/abstract-type-refining-tnh-exact-casts.wast @@ -5,15 +5,15 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $uninstantiated (sub (descriptor $uninstantiated.desc (struct)))) - (type $uninstantiated (sub (descriptor $uninstantiated.desc (struct)))) - ;; CHECK: (type $instantiated (sub $uninstantiated (descriptor $instantiated.desc (struct)))) - - ;; CHECK: (type $uninstantiated.desc (sub (describes $uninstantiated (struct)))) - (type $uninstantiated.desc (sub (describes $uninstantiated (struct)))) - (type $instantiated (sub $uninstantiated (descriptor $instantiated.desc (struct)))) - ;; CHECK: (type $instantiated.desc (sub $uninstantiated.desc (describes $instantiated (struct)))) - (type $instantiated.desc (sub $uninstantiated.desc (describes $instantiated (struct)))) + ;; CHECK-NEXT: (type $uninstantiated (sub (descriptor $uninstantiated.desc) (struct))) + (type $uninstantiated (sub (descriptor $uninstantiated.desc) (struct))) + ;; CHECK: (type $instantiated (sub $uninstantiated (descriptor $instantiated.desc) (struct))) + + ;; CHECK: (type $uninstantiated.desc (sub (describes $uninstantiated) (struct))) + (type $uninstantiated.desc (sub (describes $uninstantiated) (struct))) + (type $instantiated (sub $uninstantiated (descriptor $instantiated.desc) (struct))) + ;; CHECK: (type $instantiated.desc (sub $uninstantiated.desc (describes $instantiated) (struct))) + (type $instantiated.desc (sub $uninstantiated.desc (describes $instantiated) (struct))) ) ;; CHECK: (import "" "" (func $effect (type $5))) diff --git a/test/lit/passes/cfp-desc.wast b/test/lit/passes/cfp-desc.wast index 6a2587d3709..43097e28386 100644 --- a/test/lit/passes/cfp-desc.wast +++ b/test/lit/passes/cfp-desc.wast @@ -5,10 +5,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (descriptor $B (struct))) - (type $A (descriptor $B (struct))) - ;; CHECK: (type $B (describes $A (struct))) - (type $B (describes $A (struct))) + ;; CHECK-NEXT: (type $A (descriptor $B) (struct)) + (type $A (descriptor $B) (struct)) + ;; CHECK: (type $B (describes $A) (struct)) + (type $B (describes $A) (struct)) ) (type $struct (struct i32)) @@ -38,10 +38,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (descriptor $B (struct))) - (type $A (descriptor $B (struct))) - ;; CHECK: (type $B (describes $A (struct))) - (type $B (describes $A (struct))) + ;; CHECK-NEXT: (type $A (descriptor $B) (struct)) + (type $A (descriptor $B) (struct)) + ;; CHECK: (type $B (describes $A) (struct)) + (type $B (describes $A) (struct)) ) @@ -86,10 +86,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (descriptor $B (struct))) - (type $A (descriptor $B (struct))) - ;; CHECK: (type $B (describes $A (struct))) - (type $B (describes $A (struct))) + ;; CHECK-NEXT: (type $A (descriptor $B) (struct)) + (type $A (descriptor $B) (struct)) + ;; CHECK: (type $B (describes $A) (struct)) + (type $B (describes $A) (struct)) ) @@ -139,10 +139,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (descriptor $B (struct))) - (type $A (descriptor $B (struct))) - ;; CHECK: (type $B (describes $A (struct))) - (type $B (describes $A (struct))) + ;; CHECK-NEXT: (type $A (descriptor $B) (struct)) + (type $A (descriptor $B) (struct)) + ;; CHECK: (type $B (describes $A) (struct)) + (type $B (describes $A) (struct)) ) @@ -196,15 +196,15 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) - - ;; CHECK: (type $B (sub (descriptor $B.desc (struct)))) - (type $B (sub (descriptor $B.desc (struct)))) - ;; CHECK: (type $B.desc (sub (describes $B (struct)))) - (type $B.desc (sub (describes $B (struct)))) + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) + + ;; CHECK: (type $B (sub (descriptor $B.desc) (struct))) + (type $B (sub (descriptor $B.desc) (struct))) + ;; CHECK: (type $B.desc (sub (describes $B) (struct))) + (type $B.desc (sub (describes $B) (struct))) ) ;; CHECK: (type $4 (func (param (ref null $A) (ref null $B)))) @@ -267,15 +267,15 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) - - ;; CHECK: (type $B (sub $A (descriptor $B.desc (struct)))) - (type $B (sub $A (descriptor $B.desc (struct)))) - ;; CHECK: (type $B.desc (sub $A.desc (describes $B (struct)))) - (type $B.desc (sub $A.desc (describes $B (struct)))) + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) + + ;; CHECK: (type $B (sub $A (descriptor $B.desc) (struct))) + (type $B (sub $A (descriptor $B.desc) (struct))) + ;; CHECK: (type $B.desc (sub $A.desc (describes $B) (struct))) + (type $B.desc (sub $A.desc (describes $B) (struct))) ) ;; CHECK: (type $4 (func (param (ref null $A) (ref null $B)))) @@ -333,15 +333,15 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) - - ;; CHECK: (type $B (sub $A (descriptor $B.desc (struct)))) - (type $B (sub $A (descriptor $B.desc (struct)))) - ;; CHECK: (type $B.desc (sub $A.desc (describes $B (struct)))) - (type $B.desc (sub $A.desc (describes $B (struct)))) + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) + + ;; CHECK: (type $B (sub $A (descriptor $B.desc) (struct))) + (type $B (sub $A (descriptor $B.desc) (struct))) + ;; CHECK: (type $B.desc (sub $A.desc (describes $B) (struct))) + (type $B.desc (sub $A.desc (describes $B) (struct))) ) ;; CHECK: (type $4 (func (param (ref null $A) (ref null $B)))) @@ -406,10 +406,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (descriptor $B (struct))) - (type $A (descriptor $B (struct))) - ;; CHECK: (type $B (describes $A (struct))) - (type $B (describes $A (struct))) + ;; CHECK-NEXT: (type $A (descriptor $B) (struct)) + (type $A (descriptor $B) (struct)) + ;; CHECK: (type $B (describes $A) (struct)) + (type $B (describes $A) (struct)) ) ;; CHECK: (type $2 (func (result (ref (exact $B))))) diff --git a/test/lit/passes/cfp-reftest-desc.wast b/test/lit/passes/cfp-reftest-desc.wast index d53cc428759..fd843cba8d2 100644 --- a/test/lit/passes/cfp-reftest-desc.wast +++ b/test/lit/passes/cfp-reftest-desc.wast @@ -7,20 +7,20 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $super (sub (descriptor $super.desc (struct)))) - (type $super (sub (descriptor $super.desc (struct)))) - ;; CHECK: (type $super.desc (sub (describes $super (struct)))) - (type $super.desc (sub (describes $super (struct)))) - - ;; CHECK: (type $A (sub $super (descriptor $A.desc (struct)))) - (type $A (sub $super (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub $super.desc (describes $A (struct)))) - (type $A.desc (sub $super.desc (describes $A (struct)))) - - ;; CHECK: (type $B (sub $super (descriptor $B.desc (struct)))) - (type $B (sub $super (descriptor $B.desc (struct)))) - ;; CHECK: (type $B.desc (sub $super.desc (describes $B (struct)))) - (type $B.desc (sub $super.desc (describes $B (struct)))) + ;; CHECK-NEXT: (type $super (sub (descriptor $super.desc) (struct))) + (type $super (sub (descriptor $super.desc) (struct))) + ;; CHECK: (type $super.desc (sub (describes $super) (struct))) + (type $super.desc (sub (describes $super) (struct))) + + ;; CHECK: (type $A (sub $super (descriptor $A.desc) (struct))) + (type $A (sub $super (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub $super.desc (describes $A) (struct))) + (type $A.desc (sub $super.desc (describes $A) (struct))) + + ;; CHECK: (type $B (sub $super (descriptor $B.desc) (struct))) + (type $B (sub $super (descriptor $B.desc) (struct))) + ;; CHECK: (type $B.desc (sub $super.desc (describes $B) (struct))) + (type $B.desc (sub $super.desc (describes $B) (struct))) ) @@ -109,18 +109,18 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $super (sub (descriptor $super.desc (struct)))) - (type $super (sub (descriptor $super.desc (struct)))) - ;; CHECK: (type $super.desc (sub (describes $super (struct)))) - (type $super.desc (sub (describes $super (struct)))) + ;; CHECK-NEXT: (type $super (sub (descriptor $super.desc) (struct))) + (type $super (sub (descriptor $super.desc) (struct))) + ;; CHECK: (type $super.desc (sub (describes $super) (struct))) + (type $super.desc (sub (describes $super) (struct))) ;; CHECK: (type $func (func (param i32) (result i32))) (type $func (func (param i32) (result i32))) - ;; CHECK: (type $sub (sub $super (descriptor $sub.desc (struct)))) - (type $sub (sub $super (descriptor $sub.desc (struct)))) - ;; CHECK: (type $sub.desc (sub $super.desc (describes $sub (struct)))) - (type $sub.desc (sub $super.desc (describes $sub (struct)))) + ;; CHECK: (type $sub (sub $super (descriptor $sub.desc) (struct))) + (type $sub (sub $super (descriptor $sub.desc) (struct))) + ;; CHECK: (type $sub.desc (sub $super.desc (describes $sub) (struct))) + (type $sub.desc (sub $super.desc (describes $sub) (struct))) ) ;; CHECK: (type $5 (func (result (ref (exact $super.desc))))) diff --git a/test/lit/passes/gsi-desc.wast b/test/lit/passes/gsi-desc.wast index 0ca1806b568..e9ff223f10a 100644 --- a/test/lit/passes/gsi-desc.wast +++ b/test/lit/passes/gsi-desc.wast @@ -4,30 +4,30 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $super (sub (descriptor $super.desc (struct)))) - (type $super (sub (descriptor $super.desc (struct)))) - ;; CHECK: (type $super.desc (sub (describes $super (struct)))) - (type $super.desc (sub (describes $super (struct)))) - - ;; CHECK: (type $A (sub $super (descriptor $A.desc (struct)))) - (type $A (sub $super (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub $super.desc (describes $A (struct)))) - (type $A.desc (sub $super.desc (describes $A (struct)))) - - ;; CHECK: (type $B (sub $super (descriptor $B.desc (struct)))) - (type $B (sub $super (descriptor $B.desc (struct)))) - ;; CHECK: (type $B.desc (sub $super.desc (describes $B (struct)))) - (type $B.desc (sub $super.desc (describes $B (struct)))) - - ;; CHECK: (type $two (sub (descriptor $two.desc (struct)))) - (type $two (sub (descriptor $two.desc (struct)))) - ;; CHECK: (type $two.desc (sub (describes $two (struct)))) - (type $two.desc (sub (describes $two (struct)))) - - ;; CHECK: (type $three (sub (descriptor $three.desc (struct)))) - (type $three (sub (descriptor $three.desc (struct)))) - ;; CHECK: (type $three.desc (sub (describes $three (struct)))) - (type $three.desc (sub (describes $three (struct)))) + ;; CHECK-NEXT: (type $super (sub (descriptor $super.desc) (struct))) + (type $super (sub (descriptor $super.desc) (struct))) + ;; CHECK: (type $super.desc (sub (describes $super) (struct))) + (type $super.desc (sub (describes $super) (struct))) + + ;; CHECK: (type $A (sub $super (descriptor $A.desc) (struct))) + (type $A (sub $super (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub $super.desc (describes $A) (struct))) + (type $A.desc (sub $super.desc (describes $A) (struct))) + + ;; CHECK: (type $B (sub $super (descriptor $B.desc) (struct))) + (type $B (sub $super (descriptor $B.desc) (struct))) + ;; CHECK: (type $B.desc (sub $super.desc (describes $B) (struct))) + (type $B.desc (sub $super.desc (describes $B) (struct))) + + ;; CHECK: (type $two (sub (descriptor $two.desc) (struct))) + (type $two (sub (descriptor $two.desc) (struct))) + ;; CHECK: (type $two.desc (sub (describes $two) (struct))) + (type $two.desc (sub (describes $two) (struct))) + + ;; CHECK: (type $three (sub (descriptor $three.desc) (struct))) + (type $three (sub (descriptor $three.desc) (struct))) + ;; CHECK: (type $three.desc (sub (describes $three) (struct))) + (type $three.desc (sub (describes $three) (struct))) ) ;; CHECK: (type $10 (func (param (ref $super) (ref $A) (ref $B)))) diff --git a/test/lit/passes/gsi-nontype.wast b/test/lit/passes/gsi-nontype.wast index 899fd04fa5a..0812c4ffe73 100644 --- a/test/lit/passes/gsi-nontype.wast +++ b/test/lit/passes/gsi-nontype.wast @@ -150,10 +150,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (sub (descriptor $desc (struct)))) - (type $struct (sub (descriptor $desc (struct)))) - ;; CHECK: (type $desc (sub (describes $struct (struct)))) - (type $desc (sub (describes $struct (struct)))) + ;; CHECK-NEXT: (type $struct (sub (descriptor $desc) (struct))) + (type $struct (sub (descriptor $desc) (struct))) + ;; CHECK: (type $desc (sub (describes $struct) (struct))) + (type $desc (sub (describes $struct) (struct))) ) @@ -250,10 +250,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) ) diff --git a/test/lit/passes/gto-desc.wast b/test/lit/passes/gto-desc.wast index 1f6fe34b08a..fb214aac060 100644 --- a/test/lit/passes/gto-desc.wast +++ b/test/lit/passes/gto-desc.wast @@ -5,10 +5,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (descriptor $desc (struct (field i32)))) - (type $struct (descriptor $desc (struct (field i32)))) - ;; CHECK: (type $desc (describes $struct (struct))) - (type $desc (describes $struct (struct))) + ;; CHECK-NEXT: (type $struct (descriptor $desc) (struct (field i32))) + (type $struct (descriptor $desc) (struct (field i32))) + ;; CHECK: (type $desc (describes $struct) (struct)) + (type $desc (describes $struct) (struct)) ;; CHECK: (type $pair (struct)) (type $pair (struct (field (ref $struct)) (field (ref $struct)))) ;; CHECK: (type $used-pair (struct (field (ref $struct)) (field (ref $struct)))) @@ -134,10 +134,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (descriptor $B (struct))) - (type $A (descriptor $B (struct))) - ;; CHECK: (type $B (describes $A (struct))) - (type $B (describes $A (struct))) + ;; CHECK-NEXT: (type $A (descriptor $B) (struct)) + (type $A (descriptor $B) (struct)) + ;; CHECK: (type $B (describes $A) (struct)) + (type $B (describes $A) (struct)) ) ;; CHECK: (type $2 (func)) diff --git a/test/lit/passes/gufa-closed-open.wast b/test/lit/passes/gufa-closed-open.wast index 0269a0e39bc..c87c811df84 100644 --- a/test/lit/passes/gufa-closed-open.wast +++ b/test/lit/passes/gufa-closed-open.wast @@ -134,13 +134,13 @@ (module (rec ;; OPEND: (rec - ;; OPEND-NEXT: (type $A (sub (descriptor $A.desc (struct)))) + ;; OPEND-NEXT: (type $A (sub (descriptor $A.desc) (struct))) ;; CLOSE: (rec - ;; CLOSE-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; OPEND: (type $A.desc (sub (describes $A (struct)))) - ;; CLOSE: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) + ;; CLOSE-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; OPEND: (type $A.desc (sub (describes $A) (struct))) + ;; CLOSE: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) ) ;; OPEND: (type $2 (func (result anyref))) diff --git a/test/lit/passes/gufa-desc.wast b/test/lit/passes/gufa-desc.wast index f961e4e7418..8b8f6d8bc21 100644 --- a/test/lit/passes/gufa-desc.wast +++ b/test/lit/passes/gufa-desc.wast @@ -5,11 +5,11 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (sub (descriptor $desc (struct (field i32) (field i32) (field i32))))) - (type $struct (sub (descriptor $desc (struct (field i32) (field i32) (field i32))))) + ;; CHECK-NEXT: (type $struct (sub (descriptor $desc) (struct (field i32) (field i32) (field i32)))) + (type $struct (sub (descriptor $desc) (struct (field i32) (field i32) (field i32)))) - ;; CHECK: (type $desc (sub (describes $struct (struct (field funcref))))) - (type $desc (sub (describes $struct (struct (field funcref))))) + ;; CHECK: (type $desc (sub (describes $struct) (struct (field funcref)))) + (type $desc (sub (describes $struct) (struct (field funcref)))) ) ;; CHECK: (type $2 (func (result i32))) @@ -134,17 +134,17 @@ ;; CHECK-NEXT: (type $parent (sub (struct (field i32) (field i32) (field i32)))) (type $parent (sub (struct (field i32) (field i32) (field i32)))) - ;; CHECK: (type $struct (sub $parent (descriptor $desc (struct (field i32) (field i32) (field i32))))) - (type $struct (sub $parent (descriptor $desc (struct (field i32) (field i32) (field i32))))) + ;; CHECK: (type $struct (sub $parent (descriptor $desc) (struct (field i32) (field i32) (field i32)))) + (type $struct (sub $parent (descriptor $desc) (struct (field i32) (field i32) (field i32)))) - ;; CHECK: (type $desc (sub (describes $struct (struct (field funcref))))) - (type $desc (sub (describes $struct (struct (field funcref))))) + ;; CHECK: (type $desc (sub (describes $struct) (struct (field funcref)))) + (type $desc (sub (describes $struct) (struct (field funcref)))) - ;; CHECK: (type $sub (sub $struct (descriptor $subdesc (struct (field i32) (field i32) (field i32))))) - (type $sub (sub $struct (descriptor $subdesc (struct (field i32) (field i32) (field i32))))) + ;; CHECK: (type $sub (sub $struct (descriptor $subdesc) (struct (field i32) (field i32) (field i32)))) + (type $sub (sub $struct (descriptor $subdesc) (struct (field i32) (field i32) (field i32)))) - ;; CHECK: (type $subdesc (sub $desc (describes $sub (struct (field funcref))))) - (type $subdesc (sub $desc (describes $sub (struct (field funcref))))) + ;; CHECK: (type $subdesc (sub $desc (describes $sub) (struct (field funcref)))) + (type $subdesc (sub $desc (describes $sub) (struct (field funcref)))) ) @@ -380,17 +380,17 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (sub (descriptor $desc (struct (field i32) (field i32) (field i32))))) - (type $struct (sub (descriptor $desc (struct (field i32) (field i32) (field i32))))) + ;; CHECK-NEXT: (type $struct (sub (descriptor $desc) (struct (field i32) (field i32) (field i32)))) + (type $struct (sub (descriptor $desc) (struct (field i32) (field i32) (field i32)))) - ;; CHECK: (type $desc (sub (describes $struct (struct (field funcref))))) - (type $desc (sub (describes $struct (struct (field funcref))))) + ;; CHECK: (type $desc (sub (describes $struct) (struct (field funcref)))) + (type $desc (sub (describes $struct) (struct (field funcref)))) - ;; CHECK: (type $sub (sub $struct (descriptor $subdesc (struct (field i32) (field i32) (field i32))))) - (type $sub (sub $struct (descriptor $subdesc (struct (field i32) (field i32) (field i32))))) + ;; CHECK: (type $sub (sub $struct (descriptor $subdesc) (struct (field i32) (field i32) (field i32)))) + (type $sub (sub $struct (descriptor $subdesc) (struct (field i32) (field i32) (field i32)))) - ;; CHECK: (type $subdesc (sub $desc (describes $sub (struct (field funcref))))) - (type $subdesc (sub $desc (describes $sub (struct (field funcref))))) + ;; CHECK: (type $subdesc (sub $desc (describes $sub) (struct (field funcref)))) + (type $subdesc (sub $desc (describes $sub) (struct (field funcref)))) ) ;; CHECK: (type $4 (func (result i32))) @@ -535,14 +535,14 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (descriptor $B (struct (field i32)))) - (type $A (descriptor $B (struct (field i32)))) + ;; CHECK-NEXT: (type $A (descriptor $B) (struct (field i32))) + (type $A (descriptor $B) (struct (field i32))) - ;; CHECK: (type $B (describes $A (descriptor $C (struct (field i32))))) - (type $B (describes $A (descriptor $C (struct (field i32))))) + ;; CHECK: (type $B (describes $A) (descriptor $C) (struct (field i32))) + (type $B (describes $A) (descriptor $C) (struct (field i32))) - ;; CHECK: (type $C (describes $B (struct (field i32)))) - (type $C (describes $B (struct (field i32)))) + ;; CHECK: (type $C (describes $B) (struct (field i32))) + (type $C (describes $B) (struct (field i32))) ) ;; CHECK: (type $3 (func)) diff --git a/test/lit/passes/heap-store-optimization-desc.wast b/test/lit/passes/heap-store-optimization-desc.wast index 24797902fb4..7c0256d0903 100644 --- a/test/lit/passes/heap-store-optimization-desc.wast +++ b/test/lit/passes/heap-store-optimization-desc.wast @@ -5,12 +5,12 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (descriptor $desc (struct (field (mut i32))))) - (type $struct (descriptor $desc (struct (field (mut i32))))) - ;; CHECK: (type $desc (describes $struct (descriptor $meta (struct)))) - (type $desc (describes $struct (descriptor $meta (struct)))) - ;; CHECK: (type $meta (describes $desc (struct))) - (type $meta (describes $desc (struct))) + ;; CHECK-NEXT: (type $struct (descriptor $desc) (struct (field (mut i32)))) + (type $struct (descriptor $desc) (struct (field (mut i32)))) + ;; CHECK: (type $desc (describes $struct) (descriptor $meta) (struct)) + (type $desc (describes $struct) (descriptor $meta) (struct)) + ;; CHECK: (type $meta (describes $desc) (struct)) + (type $meta (describes $desc) (struct)) ) ;; CHECK: (import "" "" (func $effect (type $3))) diff --git a/test/lit/passes/heap2local-desc.wast b/test/lit/passes/heap2local-desc.wast index 02a3bc721c9..69b7959abe4 100644 --- a/test/lit/passes/heap2local-desc.wast +++ b/test/lit/passes/heap2local-desc.wast @@ -6,30 +6,30 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $described (descriptor $descriptor (struct (field i32)))) - (type $described (descriptor $descriptor (struct (field i32)))) - ;; CHECK: (type $descriptor (describes $described (struct (field i64)))) - (type $descriptor (describes $described (struct (field i64)))) + ;; CHECK-NEXT: (type $described (descriptor $descriptor) (struct (field i32))) + (type $described (descriptor $descriptor) (struct (field i32))) + ;; CHECK: (type $descriptor (describes $described) (struct (field i64))) + (type $descriptor (describes $described) (struct (field i64))) - ;; CHECK: (type $super (sub (descriptor $super.desc (struct)))) - (type $super (sub (descriptor $super.desc (struct)))) - ;; CHECK: (type $super.desc (sub (describes $super (struct)))) - (type $super.desc (sub (describes $super (struct)))) + ;; CHECK: (type $super (sub (descriptor $super.desc) (struct))) + (type $super (sub (descriptor $super.desc) (struct))) + ;; CHECK: (type $super.desc (sub (describes $super) (struct))) + (type $super.desc (sub (describes $super) (struct))) - ;; CHECK: (type $sub (sub $super (descriptor $sub.desc (struct)))) - (type $sub (sub $super (descriptor $sub.desc (struct)))) - ;; CHECK: (type $sub.desc (sub $super.desc (describes $sub (struct)))) - (type $sub.desc (sub $super.desc (describes $sub (struct)))) + ;; CHECK: (type $sub (sub $super (descriptor $sub.desc) (struct))) + (type $sub (sub $super (descriptor $sub.desc) (struct))) + ;; CHECK: (type $sub.desc (sub $super.desc (describes $sub) (struct))) + (type $sub.desc (sub $super.desc (describes $sub) (struct))) ;; CHECK: (type $no-desc (struct)) (type $no-desc (struct)) - ;; CHECK: (type $chain-described (descriptor $chain-middle (struct))) - (type $chain-described (descriptor $chain-middle (struct))) - ;; CHECK: (type $chain-middle (describes $chain-described (descriptor $chain-descriptor (struct)))) - (type $chain-middle (describes $chain-described (descriptor $chain-descriptor (struct)))) - ;; CHECK: (type $chain-descriptor (describes $chain-middle (struct))) - (type $chain-descriptor (describes $chain-middle (struct))) + ;; CHECK: (type $chain-described (descriptor $chain-middle) (struct)) + (type $chain-described (descriptor $chain-middle) (struct)) + ;; CHECK: (type $chain-middle (describes $chain-described) (descriptor $chain-descriptor) (struct)) + (type $chain-middle (describes $chain-described) (descriptor $chain-descriptor) (struct)) + ;; CHECK: (type $chain-descriptor (describes $chain-middle) (struct)) + (type $chain-descriptor (describes $chain-middle) (struct)) ) ;; CHECK: (type $10 (func)) @@ -860,10 +860,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (sub (descriptor $desc (struct)))) - (type $struct (sub (descriptor $desc (struct)))) - ;; CHECK: (type $desc (describes $struct (struct))) - (type $desc (describes $struct (struct))) + ;; CHECK-NEXT: (type $struct (sub (descriptor $desc) (struct))) + (type $struct (sub (descriptor $desc) (struct))) + ;; CHECK: (type $desc (describes $struct) (struct)) + (type $desc (describes $struct) (struct)) ) ;; CHECK: (type $2 (func (result (ref (exact $desc))))) @@ -961,15 +961,15 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (descriptor $B (struct))) - (type $A (descriptor $B (struct))) - ;; CHECK: (type $B (describes $A (struct))) - (type $B (describes $A (struct))) + ;; CHECK-NEXT: (type $A (descriptor $B) (struct)) + (type $A (descriptor $B) (struct)) + ;; CHECK: (type $B (describes $A) (struct)) + (type $B (describes $A) (struct)) - ;; CHECK: (type $A2 (descriptor $B2 (struct))) - (type $A2 (descriptor $B2 (struct))) - ;; CHECK: (type $B2 (describes $A2 (struct))) - (type $B2 (describes $A2 (struct))) + ;; CHECK: (type $A2 (descriptor $B2) (struct)) + (type $A2 (descriptor $B2) (struct)) + ;; CHECK: (type $B2 (describes $A2) (struct)) + (type $B2 (describes $A2) (struct)) ) ;; CHECK: (type $4 (func (result (ref $A)))) @@ -1007,8 +1007,8 @@ (module (rec - (type $A (descriptor $B (struct))) - (type $B (sub (describes $A (struct)))) + (type $A (descriptor $B) (struct)) + (type $B (sub (describes $A) (struct))) ) ;; CHECK: (type $0 (func)) @@ -1060,10 +1060,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (descriptor $B (struct (field v128)))) - (type $A (descriptor $B (struct (field v128)))) - ;; CHECK: (type $B (describes $A (struct))) - (type $B (describes $A (struct))) + ;; CHECK-NEXT: (type $A (descriptor $B) (struct (field v128))) + (type $A (descriptor $B) (struct (field v128))) + ;; CHECK: (type $B (describes $A) (struct)) + (type $B (describes $A) (struct)) ) ;; CHECK: (type $2 (func)) @@ -1148,12 +1148,12 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (shared (descriptor $B (struct)))) - (type $A (shared (descriptor $B (struct)))) - ;; CHECK: (type $B (sub (shared (describes $A (descriptor $C (struct)))))) - (type $B (sub (shared (describes $A (descriptor $C (struct)))))) - ;; CHECK: (type $C (sub (shared (describes $B (struct))))) - (type $C (sub (shared (describes $B (struct))))) + ;; CHECK-NEXT: (type $A (shared (descriptor $B) (struct))) + (type $A (shared (descriptor $B) (struct))) + ;; CHECK: (type $B (sub (shared (describes $A) (descriptor $C) (struct)))) + (type $B (sub (shared (describes $A) (descriptor $C) (struct)))) + ;; CHECK: (type $C (sub (shared (describes $B) (struct)))) + (type $C (sub (shared (describes $B) (struct)))) ) ;; CHECK: (type $3 (func (result (ref (shared any))))) @@ -1221,10 +1221,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (sub (descriptor $desc (struct)))) - (type $struct (sub (descriptor $desc (struct)))) - ;; CHECK: (type $desc (describes $struct (struct))) - (type $desc (sub final (describes $struct (struct)))) + ;; CHECK-NEXT: (type $struct (sub (descriptor $desc) (struct))) + (type $struct (sub (descriptor $desc) (struct))) + ;; CHECK: (type $desc (describes $struct) (struct)) + (type $desc (sub final (describes $struct) (struct))) ) ;; CHECK: (type $2 (func (result i32))) diff --git a/test/lit/passes/j2cl-merge-itables-desc.wast b/test/lit/passes/j2cl-merge-itables-desc.wast index ec32f9eab14..7d3488a83c1 100644 --- a/test/lit/passes/j2cl-merge-itables-desc.wast +++ b/test/lit/passes/j2cl-merge-itables-desc.wast @@ -7,29 +7,29 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $Object (sub (descriptor $Object.vtable (struct (field $itable (ref $Object.itable)))))) - (type $Object (sub (descriptor $Object.vtable (struct - (field $itable (ref $Object.itable)))))) + ;; CHECK-NEXT: (type $Object (sub (descriptor $Object.vtable) (struct (field $itable (ref $Object.itable))))) + (type $Object (sub (descriptor $Object.vtable) (struct + (field $itable (ref $Object.itable))))) - ;; CHECK: (type $SubObject (sub $Object (descriptor $SubObject.vtable (struct (field $itable (ref $Object.itable)))))) - (type $SubObject (sub $Object (descriptor $SubObject.vtable (struct - (field $itable (ref $Object.itable)))))) + ;; CHECK: (type $SubObject (sub $Object (descriptor $SubObject.vtable) (struct (field $itable (ref $Object.itable))))) + (type $SubObject (sub $Object (descriptor $SubObject.vtable) (struct + (field $itable (ref $Object.itable))))) ;; CHECK: (type $function (func)) (type $function (func)) ;; The $Object.itable field (a structref) will be added as a field after ;; the first field of this vtable. - ;; CHECK: (type $Object.vtable (sub (describes $Object (struct (field externref) (field structref))))) - (type $Object.vtable (sub (describes $Object (struct - (field externref))))) + ;; CHECK: (type $Object.vtable (sub (describes $Object) (struct (field externref) (field structref)))) + (type $Object.vtable (sub (describes $Object) (struct + (field externref)))) ;; The $Object.itable field (a structref) will be added as a field after ;; the first field of this vtable. - ;; CHECK: (type $SubObject.vtable (sub $Object.vtable (describes $SubObject (struct (field externref) (field structref) (field (ref $function)))))) - (type $SubObject.vtable (sub $Object.vtable (describes $SubObject (struct + ;; CHECK: (type $SubObject.vtable (sub $Object.vtable (describes $SubObject) (struct (field externref) (field structref) (field (ref $function))))) + (type $SubObject.vtable (sub $Object.vtable (describes $SubObject) (struct (field externref) - (field (ref $function)))))) + (field (ref $function))))) ;; CHECK: (type $Object.itable (struct (field structref))) (type $Object.itable (struct @@ -133,13 +133,13 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $Object (sub (descriptor $Object.vtable (struct (field $itable (ref $Object.itable)))))) - (type $Object (sub (descriptor $Object.vtable (struct - (field $itable (ref $Object.itable)))))) + ;; CHECK-NEXT: (type $Object (sub (descriptor $Object.vtable) (struct (field $itable (ref $Object.itable))))) + (type $Object (sub (descriptor $Object.vtable) (struct + (field $itable (ref $Object.itable))))) - ;; CHECK: (type $SubObject (sub $Object (descriptor $SubObject.vtable (struct (field $itable (ref $SubObject.itable)))))) - (type $SubObject (sub $Object (descriptor $SubObject.vtable (struct - (field $itable (ref $SubObject.itable)))))) + ;; CHECK: (type $SubObject (sub $Object (descriptor $SubObject.vtable) (struct (field $itable (ref $SubObject.itable))))) + (type $SubObject (sub $Object (descriptor $SubObject.vtable) (struct + (field $itable (ref $SubObject.itable))))) ;; CHECK: (type $function (func)) (type $function (func)) @@ -154,16 +154,16 @@ ;; The $Object.itable field (a structref) will be added as a field after ;; the first field of this vtable. - ;; CHECK: (type $Object.vtable (sub (describes $Object (struct (field externref) (field structref))))) - (type $Object.vtable (sub (describes $Object (struct - (field externref))))) + ;; CHECK: (type $Object.vtable (sub (describes $Object) (struct (field externref) (field structref)))) + (type $Object.vtable (sub (describes $Object) (struct + (field externref)))) ;; The $SubObject.itable field (a structref) will be added as a field after ;; the first field of this vtable. - ;; CHECK: (type $SubObject.vtable (sub $Object.vtable (describes $SubObject (struct (field externref) (field structref) (field (ref $function)))))) - (type $SubObject.vtable (sub $Object.vtable (describes $SubObject (struct + ;; CHECK: (type $SubObject.vtable (sub $Object.vtable (describes $SubObject) (struct (field externref) (field structref) (field (ref $function))))) + (type $SubObject.vtable (sub $Object.vtable (describes $SubObject) (struct (field externref) - (field (ref $function)))))) + (field (ref $function))))) ) ;; The initialization for the itable field (null struct) will be added to this diff --git a/test/lit/passes/minimize-rec-groups-desc.wast b/test/lit/passes/minimize-rec-groups-desc.wast index 8d62460e172..ac7405fd509 100644 --- a/test/lit/passes/minimize-rec-groups-desc.wast +++ b/test/lit/passes/minimize-rec-groups-desc.wast @@ -5,20 +5,20 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $a (descriptor $a.desc (struct))) - (type $a (descriptor $a.desc (struct))) - ;; CHECK: (type $a.desc (describes $a (struct))) - (type $a.desc (describes $a (struct))) - ;; CHECK: (rec - ;; CHECK-NEXT: (type $b (descriptor $b.desc (struct (field i32)))) - (type $b (descriptor $b.desc (struct (field i32)))) - ;; CHECK: (type $b.desc (describes $b (struct))) - (type $b.desc (describes $b (struct))) - ;; CHECK: (rec - ;; CHECK-NEXT: (type $c (descriptor $c.desc (struct (field i64)))) - (type $c (descriptor $c.desc (struct (field i64)))) - ;; CHECK: (type $c.desc (describes $c (struct))) - (type $c.desc (describes $c (struct))) + ;; CHECK-NEXT: (type $a (descriptor $a.desc) (struct)) + (type $a (descriptor $a.desc) (struct)) + ;; CHECK: (type $a.desc (describes $a) (struct)) + (type $a.desc (describes $a) (struct)) + ;; CHECK: (rec + ;; CHECK-NEXT: (type $b (descriptor $b.desc) (struct (field i32))) + (type $b (descriptor $b.desc) (struct (field i32))) + ;; CHECK: (type $b.desc (describes $b) (struct)) + (type $b.desc (describes $b) (struct)) + ;; CHECK: (rec + ;; CHECK-NEXT: (type $c (descriptor $c.desc) (struct (field i64))) + (type $c (descriptor $c.desc) (struct (field i64))) + ;; CHECK: (type $c.desc (describes $c) (struct)) + (type $c.desc (describes $c) (struct)) ) ;; CHECK: (global $a (ref null $a) (ref.null none)) (global $a (ref null $a) (ref.null none)) @@ -32,19 +32,19 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $a.1 (descriptor $a.2 (struct))) - (type $a.1 (descriptor $a.2 (struct))) - ;; CHECK: (type $a.2 (describes $a.1 (descriptor $a.3 (struct)))) - (type $a.2 (describes $a.1 (descriptor $a.3 (struct)))) - ;; CHECK: (type $a.3 (describes $a.2 (struct))) - (type $a.3 (describes $a.2 (struct))) - ;; CHECK: (rec - ;; CHECK-NEXT: (type $b.1 (descriptor $b.2 (struct (field i32)))) - (type $b.1 (descriptor $b.2 (struct (field i32)))) - ;; CHECK: (type $b.2 (describes $b.1 (descriptor $b.3 (struct)))) - (type $b.2 (describes $b.1 (descriptor $b.3 (struct)))) - ;; CHECK: (type $b.3 (describes $b.2 (struct))) - (type $b.3 (describes $b.2 (struct))) + ;; CHECK-NEXT: (type $a.1 (descriptor $a.2) (struct)) + (type $a.1 (descriptor $a.2) (struct)) + ;; CHECK: (type $a.2 (describes $a.1) (descriptor $a.3) (struct)) + (type $a.2 (describes $a.1) (descriptor $a.3) (struct)) + ;; CHECK: (type $a.3 (describes $a.2) (struct)) + (type $a.3 (describes $a.2) (struct)) + ;; CHECK: (rec + ;; CHECK-NEXT: (type $b.1 (descriptor $b.2) (struct (field i32))) + (type $b.1 (descriptor $b.2) (struct (field i32))) + ;; CHECK: (type $b.2 (describes $b.1) (descriptor $b.3) (struct)) + (type $b.2 (describes $b.1) (descriptor $b.3) (struct)) + ;; CHECK: (type $b.3 (describes $b.2) (struct)) + (type $b.3 (describes $b.2) (struct)) ) ;; CHECK: (global $a (ref null $a.1) (ref.null none)) @@ -58,38 +58,38 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $a (descriptor $a.desc (struct))) - (type $a (descriptor $a.desc (struct))) - ;; CHECK: (type $a.desc (describes $a (struct))) - (type $a.desc (describes $a (struct))) + ;; CHECK-NEXT: (type $a (descriptor $a.desc) (struct)) + (type $a (descriptor $a.desc) (struct)) + ;; CHECK: (type $a.desc (describes $a) (struct)) + (type $a.desc (describes $a) (struct)) ;; CHECK: (rec ;; CHECK-NEXT: (type $2 (struct)) - ;; CHECK: (type $b (descriptor $b.desc (struct))) - (type $b (descriptor $b.desc (struct))) - ;; CHECK: (type $b.desc (describes $b (struct))) - (type $b.desc (describes $b (struct))) + ;; CHECK: (type $b (descriptor $b.desc) (struct)) + (type $b (descriptor $b.desc) (struct)) + ;; CHECK: (type $b.desc (describes $b) (struct)) + (type $b.desc (describes $b) (struct)) ;; CHECK: (rec - ;; CHECK-NEXT: (type $c (descriptor $c.desc (struct))) - (type $c (descriptor $c.desc (struct))) + ;; CHECK-NEXT: (type $c (descriptor $c.desc) (struct)) + (type $c (descriptor $c.desc) (struct)) ;; CHECK: (type $6 (struct)) - ;; CHECK: (type $c.desc (describes $c (struct))) - (type $c.desc (describes $c (struct))) + ;; CHECK: (type $c.desc (describes $c) (struct)) + (type $c.desc (describes $c) (struct)) ;; CHECK: (rec - ;; CHECK-NEXT: (type $d (descriptor $d.desc (struct))) - (type $d (descriptor $d.desc (struct))) - ;; CHECK: (type $d.desc (describes $d (struct))) - (type $d.desc (describes $d (struct))) + ;; CHECK-NEXT: (type $d (descriptor $d.desc) (struct)) + (type $d (descriptor $d.desc) (struct)) + ;; CHECK: (type $d.desc (describes $d) (struct)) + (type $d.desc (describes $d) (struct)) ;; CHECK: (type $10 (struct)) ;; CHECK: (rec ;; CHECK-NEXT: (type $11 (array (mut i8))) - ;; CHECK: (type $e (descriptor $e.desc (struct))) - (type $e (descriptor $e.desc (struct))) - ;; CHECK: (type $e.desc (describes $e (struct))) - (type $e.desc (describes $e (struct))) + ;; CHECK: (type $e (descriptor $e.desc) (struct)) + (type $e (descriptor $e.desc) (struct)) + ;; CHECK: (type $e.desc (describes $e) (struct)) + (type $e.desc (describes $e) (struct)) ) ;; CHECK: (global $a (ref null $a) (ref.null none)) @@ -111,26 +111,26 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $a.other (struct (field (ref $a.desc)))) - ;; CHECK: (type $a (descriptor $a.desc (struct (field (ref $a.other))))) - (type $a (descriptor $a.desc (struct (ref $a.other)))) - ;; CHECK: (type $a.desc (describes $a (struct))) - (type $a.desc (describes $a (struct))) + ;; CHECK: (type $a (descriptor $a.desc) (struct (field (ref $a.other)))) + (type $a (descriptor $a.desc) (struct (ref $a.other))) + ;; CHECK: (type $a.desc (describes $a) (struct)) + (type $a.desc (describes $a) (struct)) (type $a.other (struct (ref $a.desc))) ;; CHECK: (rec - ;; CHECK-NEXT: (type $b (descriptor $b.desc (struct (field (ref $b.other))))) - (type $b (descriptor $b.desc (struct (ref $b.other)))) + ;; CHECK-NEXT: (type $b (descriptor $b.desc) (struct (field (ref $b.other)))) + (type $b (descriptor $b.desc) (struct (ref $b.other))) ;; CHECK: (type $b.other (struct (field (ref $b.desc)))) - ;; CHECK: (type $b.desc (describes $b (struct))) - (type $b.desc (describes $b (struct))) + ;; CHECK: (type $b.desc (describes $b) (struct)) + (type $b.desc (describes $b) (struct)) (type $b.other (struct (ref $b.desc))) ;; CHECK: (rec - ;; CHECK-NEXT: (type $c (descriptor $c.desc (struct (field (ref $c.other))))) - (type $c (descriptor $c.desc (struct (ref $c.other)))) - ;; CHECK: (type $c.desc (describes $c (struct))) - (type $c.desc (describes $c (struct))) + ;; CHECK-NEXT: (type $c (descriptor $c.desc) (struct (field (ref $c.other)))) + (type $c (descriptor $c.desc) (struct (ref $c.other))) + ;; CHECK: (type $c.desc (describes $c) (struct)) + (type $c.desc (describes $c) (struct)) ;; CHECK: (type $c.other (struct (field (ref $c.desc)))) (type $c.other (struct (ref $c.desc))) @@ -139,10 +139,10 @@ ;; CHECK: (type $d.other (struct (field (ref $d.desc)))) - ;; CHECK: (type $d (descriptor $d.desc (struct (field (ref $d.other))))) - (type $d (descriptor $d.desc (struct (ref $d.other)))) - ;; CHECK: (type $d.desc (describes $d (struct))) - (type $d.desc (describes $d (struct))) + ;; CHECK: (type $d (descriptor $d.desc) (struct (field (ref $d.other)))) + (type $d (descriptor $d.desc) (struct (ref $d.other))) + ;; CHECK: (type $d.desc (describes $d) (struct)) + (type $d.desc (describes $d) (struct)) (type $d.other (struct (ref $d.desc))) ) @@ -161,37 +161,37 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $a.2 (descriptor $a.2.desc (struct (field (ref $a.1))))) + ;; CHECK-NEXT: (type $a.2 (descriptor $a.2.desc) (struct (field (ref $a.1)))) - ;; CHECK: (type $a.1 (descriptor $a.1.desc (struct (field (ref $a.2))))) - (type $a.1 (descriptor $a.1.desc (struct (field (ref $a.2))))) - ;; CHECK: (type $a.2.desc (describes $a.2 (struct))) + ;; CHECK: (type $a.1 (descriptor $a.1.desc) (struct (field (ref $a.2)))) + (type $a.1 (descriptor $a.1.desc) (struct (field (ref $a.2)))) + ;; CHECK: (type $a.2.desc (describes $a.2) (struct)) - ;; CHECK: (type $a.1.desc (describes $a.1 (struct))) - (type $a.1.desc (describes $a.1 (struct))) - (type $a.2 (descriptor $a.2.desc (struct (field (ref $a.1))))) - (type $a.2.desc (describes $a.2 (struct))) + ;; CHECK: (type $a.1.desc (describes $a.1) (struct)) + (type $a.1.desc (describes $a.1) (struct)) + (type $a.2 (descriptor $a.2.desc) (struct (field (ref $a.1)))) + (type $a.2.desc (describes $a.2) (struct)) ;; CHECK: (rec - ;; CHECK-NEXT: (type $b.2 (descriptor $b.2.desc (struct (field (ref $b.1))))) + ;; CHECK-NEXT: (type $b.2 (descriptor $b.2.desc) (struct (field (ref $b.1)))) - ;; CHECK: (type $b.1 (descriptor $b.1.desc (struct (field (ref $b.2))))) - (type $b.1 (descriptor $b.1.desc (struct (field (ref $b.2))))) - ;; CHECK: (type $b.1.desc (describes $b.1 (struct))) - (type $b.1.desc (describes $b.1 (struct))) - (type $b.2 (descriptor $b.2.desc (struct (field (ref $b.1))))) - ;; CHECK: (type $b.2.desc (describes $b.2 (struct))) - (type $b.2.desc (describes $b.2 (struct))) + ;; CHECK: (type $b.1 (descriptor $b.1.desc) (struct (field (ref $b.2)))) + (type $b.1 (descriptor $b.1.desc) (struct (field (ref $b.2)))) + ;; CHECK: (type $b.1.desc (describes $b.1) (struct)) + (type $b.1.desc (describes $b.1) (struct)) + (type $b.2 (descriptor $b.2.desc) (struct (field (ref $b.1)))) + ;; CHECK: (type $b.2.desc (describes $b.2) (struct)) + (type $b.2.desc (describes $b.2) (struct)) ;; CHECK: (rec - ;; CHECK-NEXT: (type $c.2 (descriptor $c.2.desc (struct (field (ref $c.1))))) + ;; CHECK-NEXT: (type $c.2 (descriptor $c.2.desc) (struct (field (ref $c.1)))) - ;; CHECK: (type $c.2.desc (describes $c.2 (struct))) + ;; CHECK: (type $c.2.desc (describes $c.2) (struct)) - ;; CHECK: (type $c.1 (descriptor $c.1.desc (struct (field (ref $c.2))))) - (type $c.1 (descriptor $c.1.desc (struct (field (ref $c.2))))) - ;; CHECK: (type $c.1.desc (describes $c.1 (struct))) - (type $c.1.desc (describes $c.1 (struct))) - (type $c.2 (descriptor $c.2.desc (struct (field (ref $c.1))))) - (type $c.2.desc (describes $c.2 (struct))) + ;; CHECK: (type $c.1 (descriptor $c.1.desc) (struct (field (ref $c.2)))) + (type $c.1 (descriptor $c.1.desc) (struct (field (ref $c.2)))) + ;; CHECK: (type $c.1.desc (describes $c.1) (struct)) + (type $c.1.desc (describes $c.1) (struct)) + (type $c.2 (descriptor $c.2.desc) (struct (field (ref $c.1)))) + (type $c.2.desc (describes $c.2) (struct)) ) ;; CHECK: (global $a (ref null $a.1) (ref.null none)) diff --git a/test/lit/passes/optimize-instructions-desc.wast b/test/lit/passes/optimize-instructions-desc.wast index 014363b84e8..9b2b4dbe9f8 100644 --- a/test/lit/passes/optimize-instructions-desc.wast +++ b/test/lit/passes/optimize-instructions-desc.wast @@ -6,35 +6,35 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (sub (descriptor $desc (struct)))) + ;; CHECK-NEXT: (type $struct (sub (descriptor $desc) (struct))) ;; NTRAP: (rec - ;; NTRAP-NEXT: (type $struct (sub (descriptor $desc (struct)))) - (type $struct (sub (descriptor $desc (struct)))) - ;; CHECK: (type $desc (sub (describes $struct (struct)))) - ;; NTRAP: (type $desc (sub (describes $struct (struct)))) - (type $desc (sub (describes $struct (struct)))) + ;; NTRAP-NEXT: (type $struct (sub (descriptor $desc) (struct))) + (type $struct (sub (descriptor $desc) (struct))) + ;; CHECK: (type $desc (sub (describes $struct) (struct))) + ;; NTRAP: (type $desc (sub (describes $struct) (struct))) + (type $desc (sub (describes $struct) (struct))) ) (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $sub (sub $struct (descriptor $sub.desc (struct)))) + ;; CHECK-NEXT: (type $sub (sub $struct (descriptor $sub.desc) (struct))) ;; NTRAP: (rec - ;; NTRAP-NEXT: (type $sub (sub $struct (descriptor $sub.desc (struct)))) - (type $sub (sub $struct (descriptor $sub.desc (struct)))) - ;; CHECK: (type $sub.desc (sub $desc (describes $sub (struct)))) - ;; NTRAP: (type $sub.desc (sub $desc (describes $sub (struct)))) - (type $sub.desc (sub $desc (describes $sub (struct)))) + ;; NTRAP-NEXT: (type $sub (sub $struct (descriptor $sub.desc) (struct))) + (type $sub (sub $struct (descriptor $sub.desc) (struct))) + ;; CHECK: (type $sub.desc (sub $desc (describes $sub) (struct))) + ;; NTRAP: (type $sub.desc (sub $desc (describes $sub) (struct))) + (type $sub.desc (sub $desc (describes $sub) (struct))) ) (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct-i32 (descriptor $struct-i32.desc (struct (field i32)))) + ;; CHECK-NEXT: (type $struct-i32 (descriptor $struct-i32.desc) (struct (field i32))) ;; NTRAP: (rec - ;; NTRAP-NEXT: (type $struct-i32 (descriptor $struct-i32.desc (struct (field i32)))) - (type $struct-i32 (descriptor $struct-i32.desc (struct (field i32)))) - ;; CHECK: (type $struct-i32.desc (describes $struct-i32 (struct))) - ;; NTRAP: (type $struct-i32.desc (describes $struct-i32 (struct))) - (type $struct-i32.desc (describes $struct-i32 (struct))) + ;; NTRAP-NEXT: (type $struct-i32 (descriptor $struct-i32.desc) (struct (field i32))) + (type $struct-i32 (descriptor $struct-i32.desc) (struct (field i32))) + ;; CHECK: (type $struct-i32.desc (describes $struct-i32) (struct)) + ;; NTRAP: (type $struct-i32.desc (describes $struct-i32) (struct)) + (type $struct-i32.desc (describes $struct-i32) (struct)) ) ;; CHECK: (import "" "" (func $effect (type $6))) diff --git a/test/lit/passes/precompute-desc.wast b/test/lit/passes/precompute-desc.wast index e0b261cca04..d2dc826e5c9 100644 --- a/test/lit/passes/precompute-desc.wast +++ b/test/lit/passes/precompute-desc.wast @@ -6,10 +6,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (descriptor $desc (struct))) - (type $struct (descriptor $desc (struct))) - ;; CHECK: (type $desc (describes $struct (struct))) - (type $desc (describes $struct (struct))) + ;; CHECK-NEXT: (type $struct (descriptor $desc) (struct)) + (type $struct (descriptor $desc) (struct)) + ;; CHECK: (type $desc (describes $struct) (struct)) + (type $desc (describes $struct) (struct)) ) ;; CHECK: (global $desc (ref (exact $desc)) (struct.new_default $desc)) diff --git a/test/lit/passes/remove-unused-brs-desc.wast b/test/lit/passes/remove-unused-brs-desc.wast index cfc75dc1687..7750ee02a43 100644 --- a/test/lit/passes/remove-unused-brs-desc.wast +++ b/test/lit/passes/remove-unused-brs-desc.wast @@ -4,19 +4,19 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $super (sub (descriptor $super.desc (struct)))) - (type $super (sub (descriptor $super.desc (struct)))) - ;; CHECK: (type $super.desc (sub (describes $super (struct)))) - (type $super.desc (sub (describes $super (struct)))) - ;; CHECK: (type $sub (sub $super (descriptor $sub.desc (struct)))) - (type $sub (sub $super (descriptor $sub.desc (struct)))) - ;; CHECK: (type $sub.desc (sub $super.desc (describes $sub (struct)))) - (type $sub.desc (sub $super.desc (describes $sub (struct)))) + ;; CHECK-NEXT: (type $super (sub (descriptor $super.desc) (struct))) + (type $super (sub (descriptor $super.desc) (struct))) + ;; CHECK: (type $super.desc (sub (describes $super) (struct))) + (type $super.desc (sub (describes $super) (struct))) + ;; CHECK: (type $sub (sub $super (descriptor $sub.desc) (struct))) + (type $sub (sub $super (descriptor $sub.desc) (struct))) + ;; CHECK: (type $sub.desc (sub $super.desc (describes $sub) (struct))) + (type $sub.desc (sub $super.desc (describes $sub) (struct))) - ;; CHECK: (type $other (descriptor $other.desc (struct))) - (type $other (descriptor $other.desc (struct))) - ;; CHECK: (type $other.desc (describes $other (struct))) - (type $other.desc (describes $other (struct))) + ;; CHECK: (type $other (descriptor $other.desc) (struct)) + (type $other (descriptor $other.desc) (struct)) + ;; CHECK: (type $other.desc (describes $other) (struct)) + (type $other.desc (describes $other) (struct)) ) ;; CHECK: (import "" "" (func $effect (type $14))) diff --git a/test/lit/passes/remove-unused-module-elements-refs-descriptors.wast b/test/lit/passes/remove-unused-module-elements-refs-descriptors.wast index 90869e99cdf..7f79e388872 100644 --- a/test/lit/passes/remove-unused-module-elements-refs-descriptors.wast +++ b/test/lit/passes/remove-unused-module-elements-refs-descriptors.wast @@ -6,10 +6,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (descriptor $desc (struct))) - (type $struct (descriptor $desc (struct))) - ;; CHECK: (type $desc (describes $struct (struct))) - (type $desc (describes $struct (struct))) + ;; CHECK-NEXT: (type $struct (descriptor $desc) (struct)) + (type $struct (descriptor $desc) (struct)) + ;; CHECK: (type $desc (describes $struct) (struct)) + (type $desc (describes $struct) (struct)) ) ;; CHECK: (type $2 (func)) @@ -40,10 +40,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (descriptor $desc (struct))) - (type $struct (descriptor $desc (struct))) - ;; CHECK: (type $desc (describes $struct (struct))) - (type $desc (describes $struct (struct))) + ;; CHECK-NEXT: (type $struct (descriptor $desc) (struct)) + (type $struct (descriptor $desc) (struct)) + ;; CHECK: (type $desc (describes $struct) (struct)) + (type $desc (describes $struct) (struct)) ;; CHECK: (type $list (struct (field (ref $struct)) (field (ref null $list)))) (type $list (struct (field (ref $struct)) (field (ref null $list)))) ) @@ -133,10 +133,10 @@ (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $vtable (sub (descriptor $vtable.desc (struct (field (ref $void)))))) - (type $vtable (sub (descriptor $vtable.desc (struct (field (ref $void)))))) - ;; CHECK: (type $vtable.desc (sub (describes $vtable (struct (field (ref $void)))))) - (type $vtable.desc (sub (describes $vtable (struct (field (ref $void)))))) + ;; CHECK-NEXT: (type $vtable (sub (descriptor $vtable.desc) (struct (field (ref $void))))) + (type $vtable (sub (descriptor $vtable.desc) (struct (field (ref $void))))) + ;; CHECK: (type $vtable.desc (sub (describes $vtable) (struct (field (ref $void))))) + (type $vtable.desc (sub (describes $vtable) (struct (field (ref $void))))) ) ;; CHECK: (global $vtable (ref $vtable) (struct.new $vtable diff --git a/test/lit/passes/remove-unused-types-descriptors.wast b/test/lit/passes/remove-unused-types-descriptors.wast index 00c04b973d6..9153def0c18 100644 --- a/test/lit/passes/remove-unused-types-descriptors.wast +++ b/test/lit/passes/remove-unused-types-descriptors.wast @@ -8,12 +8,12 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $described (descriptor $middle (struct))) - (type $described (descriptor $middle (struct))) - ;; CHECK: (type $middle (describes $described (descriptor $describing (struct)))) - (type $middle (describes $described (descriptor $describing (struct)))) - ;; CHECK: (type $describing (describes $middle (struct))) - (type $describing (describes $middle (struct))) + ;; CHECK-NEXT: (type $described (descriptor $middle) (struct)) + (type $described (descriptor $middle) (struct)) + ;; CHECK: (type $middle (describes $described) (descriptor $describing) (struct)) + (type $middle (describes $described) (descriptor $describing) (struct)) + ;; CHECK: (type $describing (describes $middle) (struct)) + (type $describing (describes $middle) (struct)) (type $unused (struct)) ) @@ -68,12 +68,12 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $described (descriptor $middle (struct))) - (type $described (descriptor $middle (struct))) - ;; CHECK: (type $middle (describes $described (descriptor $describing (struct)))) - (type $middle (describes $described (descriptor $describing (struct)))) - ;; CHECK: (type $describing (describes $middle (struct))) - (type $describing (describes $middle (struct))) + ;; CHECK-NEXT: (type $described (descriptor $middle) (struct)) + (type $described (descriptor $middle) (struct)) + ;; CHECK: (type $middle (describes $described) (descriptor $describing) (struct)) + (type $middle (describes $described) (descriptor $describing) (struct)) + ;; CHECK: (type $describing (describes $middle) (struct)) + (type $describing (describes $middle) (struct)) (type $unused (struct)) ) diff --git a/test/lit/passes/type-merging-desc.wast b/test/lit/passes/type-merging-desc.wast index 54d74c2216a..a8afc2c55d3 100644 --- a/test/lit/passes/type-merging-desc.wast +++ b/test/lit/passes/type-merging-desc.wast @@ -7,10 +7,10 @@ ;; CHECK: (rec ;; CHECK-NEXT: (type $A (struct)) (type $A (struct)) - ;; CHECK: (type $B (descriptor $C (struct))) - (type $B (descriptor $C (struct))) - ;; CHECK: (type $C (describes $B (struct))) - (type $C (describes $B (struct))) + ;; CHECK: (type $B (descriptor $C) (struct)) + (type $B (descriptor $C) (struct)) + ;; CHECK: (type $C (describes $B) (struct)) + (type $C (describes $B) (struct)) ) ;; The types have different shapes and should not be merged. @@ -29,18 +29,18 @@ ;; cannot merge $B into $A without also merging their full descriptor chains. (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; CHECK: (type $B (sub $A (descriptor $B.desc (struct)))) - (type $B (sub $A (descriptor $B.desc (struct)))) - ;; CHECK: (type $C (sub $B (descriptor $C.desc (struct (field i32))))) - (type $C (sub $B (descriptor $C.desc (struct (field i32))))) - ;; CHECK: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) - ;; CHECK: (type $B.desc (sub $A.desc (describes $B (struct (field anyref))))) - (type $B.desc (sub $A.desc (describes $B (struct (field anyref))))) - ;; CHECK: (type $C.desc (sub $B.desc (describes $C (struct (field eqref))))) - (type $C.desc (sub $B.desc (describes $C (struct (field eqref))))) + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; CHECK: (type $B (sub $A (descriptor $B.desc) (struct))) + (type $B (sub $A (descriptor $B.desc) (struct))) + ;; CHECK: (type $C (sub $B (descriptor $C.desc) (struct (field i32)))) + (type $C (sub $B (descriptor $C.desc) (struct (field i32)))) + ;; CHECK: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) + ;; CHECK: (type $B.desc (sub $A.desc (describes $B) (struct (field anyref)))) + (type $B.desc (sub $A.desc (describes $B) (struct (field anyref)))) + ;; CHECK: (type $C.desc (sub $B.desc (describes $C) (struct (field eqref)))) + (type $C.desc (sub $B.desc (describes $C) (struct (field eqref)))) ) ;; CHECK: (global $A (ref null $A) (ref.null none)) @@ -63,16 +63,16 @@ ;; $A.meta to be merged into. We cannot optimize here. (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) - ;; CHECK: (type $B (sub $A (descriptor $B.desc (struct)))) - (type $B (sub $A (descriptor $B.desc (struct)))) - ;; CHECK: (type $B.desc (sub $A.desc (describes $B (descriptor $B.meta (struct))))) - (type $B.desc (sub $A.desc (describes $B (descriptor $B.meta (struct))))) - ;; CHECK: (type $B.meta (describes $B.desc (struct))) - (type $B.meta (describes $B.desc (struct))) + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) + ;; CHECK: (type $B (sub $A (descriptor $B.desc) (struct))) + (type $B (sub $A (descriptor $B.desc) (struct))) + ;; CHECK: (type $B.desc (sub $A.desc (describes $B) (descriptor $B.meta) (struct))) + (type $B.desc (sub $A.desc (describes $B) (descriptor $B.meta) (struct))) + ;; CHECK: (type $B.meta (describes $B.desc) (struct)) + (type $B.meta (describes $B.desc) (struct)) ) ;; CHECK: (type $5 (func (result (ref $B.meta)))) @@ -113,14 +113,14 @@ ;; We cannot optimize because $B has an extra field. (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) - ;; CHECK: (type $B (sub $A (descriptor $B.desc (struct (field i32))))) - (type $B (sub $A (descriptor $B.desc (struct (field i32))))) - ;; CHECK: (type $B.desc (sub $A.desc (describes $B (struct)))) - (type $B.desc (sub $A.desc (describes $B (struct)))) + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) + ;; CHECK: (type $B (sub $A (descriptor $B.desc) (struct (field i32)))) + (type $B (sub $A (descriptor $B.desc) (struct (field i32)))) + ;; CHECK: (type $B.desc (sub $A.desc (describes $B) (struct))) + (type $B.desc (sub $A.desc (describes $B) (struct))) ) ;; CHECK: (type $4 (func (result (ref $B.desc)))) @@ -150,14 +150,14 @@ ;; We cannot optimize because $B.desc has an extra field. (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) - ;; CHECK: (type $B (sub $A (descriptor $B.desc (struct)))) - (type $B (sub $A (descriptor $B.desc (struct)))) - ;; CHECK: (type $B.desc (sub $A.desc (describes $B (struct (field i32))))) - (type $B.desc (sub $A.desc (describes $B (struct (field i32))))) + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) + ;; CHECK: (type $B (sub $A (descriptor $B.desc) (struct))) + (type $B (sub $A (descriptor $B.desc) (struct))) + ;; CHECK: (type $B.desc (sub $A.desc (describes $B) (struct (field i32)))) + (type $B.desc (sub $A.desc (describes $B) (struct (field i32)))) ) ;; CHECK: (type $4 (func (result (ref $B.desc)))) @@ -187,12 +187,12 @@ ;; We can optimize because $B matches $A and $B.desc matches $A.desc. (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) - (type $B (sub $A (descriptor $B.desc (struct)))) - (type $B.desc (sub $A.desc (describes $B (struct)))) + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) + (type $B (sub $A (descriptor $B.desc) (struct))) + (type $B.desc (sub $A.desc (describes $B) (struct))) ) ;; CHECK: (type $2 (func (result (ref $A.desc)))) @@ -223,14 +223,14 @@ ;; among the types in the chain differently. We cannot optimize. (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (descriptor $A.desc (struct (field i32) (field f32) (field i64)))) - (type $A (descriptor $A.desc (struct (field i32 f32 i64)))) - ;; CHECK: (type $A.desc (describes $A (struct (field f64)))) - (type $A.desc (describes $A (struct (field f64)))) - ;; CHECK: (type $B (descriptor $B.desc (struct (field i32)))) - (type $B (descriptor $B.desc (struct (field i32)))) - ;; CHECK: (type $B.desc (describes $B (struct (field f32) (field i64) (field f64)))) - (type $B.desc (describes $B (struct (field f32 i64 f64)))) + ;; CHECK-NEXT: (type $A (descriptor $A.desc) (struct (field i32) (field f32) (field i64))) + (type $A (descriptor $A.desc) (struct (field i32 f32 i64))) + ;; CHECK: (type $A.desc (describes $A) (struct (field f64))) + (type $A.desc (describes $A) (struct (field f64))) + ;; CHECK: (type $B (descriptor $B.desc) (struct (field i32))) + (type $B (descriptor $B.desc) (struct (field i32))) + ;; CHECK: (type $B.desc (describes $B) (struct (field f32) (field i64) (field f64))) + (type $B.desc (describes $B) (struct (field f32 i64 f64))) ) ;; CHECK: (global $A (ref null $A) (ref.null none)) @@ -248,14 +248,14 @@ ;; subtype chain. (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) - ;; CHECK: (type $B (sub $A (descriptor $B.desc (struct)))) - (type $B (sub $A (descriptor $B.desc (struct)))) - ;; CHECK: (type $B.desc (sub $A.desc (describes $B (struct)))) - (type $B.desc (sub $A.desc (describes $B (struct)))) + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) + ;; CHECK: (type $B (sub $A (descriptor $B.desc) (struct))) + (type $B (sub $A (descriptor $B.desc) (struct))) + ;; CHECK: (type $B.desc (sub $A.desc (describes $B) (struct))) + (type $B.desc (sub $A.desc (describes $B) (struct))) ) ;; CHECK: (type $4 (func)) @@ -291,14 +291,14 @@ ;; the supertype chain. (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) - ;; CHECK: (type $B (sub $A (descriptor $B.desc (struct)))) - (type $B (sub $A (descriptor $B.desc (struct)))) - ;; CHECK: (type $B.desc (sub $A.desc (describes $B (struct)))) - (type $B.desc (sub $A.desc (describes $B (struct)))) + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) + ;; CHECK: (type $B (sub $A (descriptor $B.desc) (struct))) + (type $B (sub $A (descriptor $B.desc) (struct))) + ;; CHECK: (type $B.desc (sub $A.desc (describes $B) (struct))) + (type $B.desc (sub $A.desc (describes $B) (struct))) ) ;; CHECK: (type $4 (func)) @@ -333,12 +333,12 @@ ;; we can still merge. (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) - (type $B (sub $A (descriptor $B.desc (struct)))) - (type $B.desc (sub $A.desc (describes $B (struct)))) + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) + (type $B (sub $A (descriptor $B.desc) (struct))) + (type $B.desc (sub $A.desc (describes $B) (struct))) ) ;; CHECK: (type $2 (func (param anyref))) @@ -373,10 +373,10 @@ ;; They should not be merged. (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $X1 (descriptor $X2 (struct))) - (type $X1 (descriptor $X2 (struct))) - ;; CHECK: (type $X2 (describes $X1 (struct))) - (type $X2 (describes $X1 (struct))) + ;; CHECK-NEXT: (type $X1 (descriptor $X2) (struct)) + (type $X1 (descriptor $X2) (struct)) + ;; CHECK: (type $X2 (describes $X1) (struct)) + (type $X2 (describes $X1) (struct)) ;; CHECK: (type $A (struct (field (ref $X1)))) (type $A (struct (ref $X1))) ;; CHECK: (type $B (struct (field (ref $X2)))) @@ -396,10 +396,10 @@ ;; Referring to a public child only later in a chain should not cause a crash. (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $use-public (descriptor $use-public.desc (struct))) - (type $use-public (descriptor $use-public.desc (struct))) - ;; CHECK: (type $use-public.desc (describes $use-public (struct (field (ref $public))))) - (type $use-public.desc (describes $use-public (struct (field (ref $public))))) + ;; CHECK-NEXT: (type $use-public (descriptor $use-public.desc) (struct)) + (type $use-public (descriptor $use-public.desc) (struct)) + ;; CHECK: (type $use-public.desc (describes $use-public) (struct (field (ref $public)))) + (type $use-public.desc (describes $use-public) (struct (field (ref $public)))) ) ;; CHECK: (global $public (ref null $public) (ref.null none)) @@ -417,10 +417,10 @@ ;; cause a crash. (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $public (descriptor $public.desc (struct))) - (type $public (descriptor $public.desc (struct))) - ;; CHECK: (type $public.desc (describes $public (struct))) - (type $public.desc (describes $public (struct))) + ;; CHECK-NEXT: (type $public (descriptor $public.desc) (struct)) + (type $public (descriptor $public.desc) (struct)) + ;; CHECK: (type $public.desc (describes $public) (struct)) + (type $public.desc (describes $public) (struct)) ) ;; CHECK: (type $use-public (struct (field (ref null $public.desc)))) (type $use-public (struct (ref null $public.desc))) diff --git a/test/lit/passes/type-ssa-desc.wast b/test/lit/passes/type-ssa-desc.wast index b4d5f972470..58b07eafb4d 100644 --- a/test/lit/passes/type-ssa-desc.wast +++ b/test/lit/passes/type-ssa-desc.wast @@ -5,10 +5,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (descriptor $desc (struct))) - (type $struct (descriptor $desc (struct))) - ;; CHECK: (type $desc (sub (describes $struct (struct (field i32))))) - (type $desc (sub (describes $struct (struct (field i32))))) + ;; CHECK-NEXT: (type $struct (descriptor $desc) (struct)) + (type $struct (descriptor $desc) (struct)) + ;; CHECK: (type $desc (sub (describes $struct) (struct (field i32)))) + (type $desc (sub (describes $struct) (struct (field i32)))) ) ;; CHECK: (type $2 (func (result (ref $desc)))) @@ -27,10 +27,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (sub (descriptor $desc (struct (field i32))))) - (type $struct (sub (descriptor $desc (struct (field i32))))) - ;; CHECK: (type $desc (describes $struct (struct))) - (type $desc (sub final (describes $struct (struct)))) + ;; CHECK-NEXT: (type $struct (sub (descriptor $desc) (struct (field i32)))) + (type $struct (sub (descriptor $desc) (struct (field i32)))) + ;; CHECK: (type $desc (describes $struct) (struct)) + (type $desc (sub final (describes $struct) (struct))) ) ;; CHECK: (type $2 (func (result (ref $struct)))) @@ -53,10 +53,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (sub (descriptor $desc (struct (field i32))))) - (type $struct (sub (descriptor $desc (struct (field i32))))) - ;; CHECK: (type $desc (sub (describes $struct (struct)))) - (type $desc (sub (describes $struct (struct)))) + ;; CHECK-NEXT: (type $struct (sub (descriptor $desc) (struct (field i32)))) + (type $struct (sub (descriptor $desc) (struct (field i32)))) + ;; CHECK: (type $desc (sub (describes $struct) (struct))) + (type $desc (sub (describes $struct) (struct))) ) ;; CHECK: (type $2 (func (result (ref $struct)))) @@ -78,14 +78,14 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $B (struct (field i32))))) - (type $A (sub (descriptor $B (struct (field i32))))) - ;; CHECK: (type $B (sub (describes $A (descriptor $C (struct))))) - (type $B (sub (describes $A (descriptor $C (struct))))) - ;; CHECK: (type $C (sub (describes $B (descriptor $D (struct))))) - (type $C (sub (describes $B (descriptor $D (struct))))) - ;; CHECK: (type $D (sub (describes $C (struct)))) - (type $D (sub (describes $C (struct)))) + ;; CHECK-NEXT: (type $A (sub (descriptor $B) (struct (field i32)))) + (type $A (sub (descriptor $B) (struct (field i32)))) + ;; CHECK: (type $B (sub (describes $A) (descriptor $C) (struct))) + (type $B (sub (describes $A) (descriptor $C) (struct))) + ;; CHECK: (type $C (sub (describes $B) (descriptor $D) (struct))) + (type $C (sub (describes $B) (descriptor $D) (struct))) + ;; CHECK: (type $D (sub (describes $C) (struct))) + (type $D (sub (describes $C) (struct))) ) ;; CHECK: (type $4 (func (result (ref $A)))) @@ -114,10 +114,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (sub (descriptor $desc (struct (field i32))))) - (type $struct (sub (descriptor $desc (struct (field i32))))) - ;; CHECK: (type $desc (sub (describes $struct (struct)))) - (type $desc (sub (describes $struct (struct)))) + ;; CHECK-NEXT: (type $struct (sub (descriptor $desc) (struct (field i32)))) + (type $struct (sub (descriptor $desc) (struct (field i32)))) + ;; CHECK: (type $desc (sub (describes $struct) (struct))) + (type $desc (sub (describes $struct) (struct))) ) ;; CHECK: (type $2 (func (result (ref $struct)))) @@ -142,10 +142,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (sub (descriptor $desc (struct (field i32))))) - (type $struct (sub (descriptor $desc (struct (field i32))))) - ;; CHECK: (type $desc (sub (describes $struct (struct)))) - (type $desc (sub (describes $struct (struct)))) + ;; CHECK-NEXT: (type $struct (sub (descriptor $desc) (struct (field i32)))) + (type $struct (sub (descriptor $desc) (struct (field i32)))) + ;; CHECK: (type $desc (sub (describes $struct) (struct))) + (type $desc (sub (describes $struct) (struct))) ) ;; CHECK: (type $2 (func (result i32))) @@ -186,14 +186,14 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $B (struct (field i32))))) - (type $A (sub (descriptor $B (struct (field i32))))) - ;; CHECK: (type $B (sub (describes $A (descriptor $C (struct))))) - (type $B (sub (describes $A (descriptor $C (struct))))) - ;; CHECK: (type $C (sub (describes $B (descriptor $D (struct))))) - (type $C (sub (describes $B (descriptor $D (struct))))) - ;; CHECK: (type $D (sub (describes $C (struct)))) - (type $D (sub (describes $C (struct)))) + ;; CHECK-NEXT: (type $A (sub (descriptor $B) (struct (field i32)))) + (type $A (sub (descriptor $B) (struct (field i32)))) + ;; CHECK: (type $B (sub (describes $A) (descriptor $C) (struct))) + (type $B (sub (describes $A) (descriptor $C) (struct))) + ;; CHECK: (type $C (sub (describes $B) (descriptor $D) (struct))) + (type $C (sub (describes $B) (descriptor $D) (struct))) + ;; CHECK: (type $D (sub (describes $C) (struct))) + (type $D (sub (describes $C) (struct))) ) ;; CHECK: (type $4 (func (result (ref $A)))) diff --git a/test/lit/passes/unsubtyping-desc-tnh.wast b/test/lit/passes/unsubtyping-desc-tnh.wast index 7b5b3770991..ef2e9a46cd3 100644 --- a/test/lit/passes/unsubtyping-desc-tnh.wast +++ b/test/lit/passes/unsubtyping-desc-tnh.wast @@ -8,9 +8,9 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct))) - (type $A (sub (descriptor $A.desc (struct)))) + (type $A (sub (descriptor $A.desc) (struct))) ;; CHECK: (type $A.desc (sub (struct))) - (type $A.desc (sub (describes $A (struct)))) + (type $A.desc (sub (describes $A) (struct))) ) ;; CHECK: (global $A.desc (ref null (exact $A.desc)) (struct.new_default $A.desc)) @@ -25,9 +25,9 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct))) - (type $A (sub (descriptor $A.desc (struct)))) + (type $A (sub (descriptor $A.desc) (struct))) ;; CHECK: (type $A.desc (sub (struct))) - (type $A.desc (sub (describes $A (struct)))) + (type $A.desc (sub (describes $A) (struct))) ) ;; CHECK: (type $2 (func (param (ref null (exact $A.desc))))) @@ -53,9 +53,9 @@ (module (rec ;; CHECK: (type $struct (sub (struct))) - (type $struct (sub (descriptor $desc (struct)))) - (type $desc (sub (describes $struct (descriptor $meta (struct))))) - (type $meta (sub (describes $desc (struct)))) + (type $struct (sub (descriptor $desc) (struct))) + (type $desc (sub (describes $struct) (descriptor $meta) (struct))) + (type $meta (sub (describes $desc) (struct))) ) ;; CHECK: (global $g (ref $struct) (struct.new_default $struct)) @@ -69,9 +69,9 @@ ;; CHECK-NEXT: (type $A (sub (struct (field (ref $struct))))) (type $A (sub (struct (field (ref $struct))))) ;; CHECK: (type $struct (sub (struct))) - (type $struct (sub (descriptor $desc (struct)))) - (type $desc (sub (describes $struct (descriptor $meta (struct))))) - (type $meta (sub (describes $desc (struct)))) + (type $struct (sub (descriptor $desc) (struct))) + (type $desc (sub (describes $struct) (descriptor $meta) (struct))) + (type $meta (sub (describes $desc) (struct))) ) ;; CHECK: (global $g (ref $A) (struct.new $A diff --git a/test/lit/passes/unsubtyping-desc.wast b/test/lit/passes/unsubtyping-desc.wast index 7761ebad2f5..4e17442aea6 100644 --- a/test/lit/passes/unsubtyping-desc.wast +++ b/test/lit/passes/unsubtyping-desc.wast @@ -8,13 +8,13 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct))) - (type $A (sub (descriptor $A.desc (struct)))) + (type $A (sub (descriptor $A.desc) (struct))) ;; CHECK: (type $A.desc (sub (struct))) - (type $A.desc (sub (describes $A (struct)))) + (type $A.desc (sub (describes $A) (struct))) ;; CHECK: (type $B (sub (struct))) - (type $B (sub $A (descriptor $B.desc (struct)))) + (type $B (sub $A (descriptor $B.desc) (struct))) ;; CHECK: (type $B.desc (sub (struct))) - (type $B.desc (sub $A.desc (describes $B (struct)))) + (type $B.desc (sub $A.desc (describes $B) (struct))) ) ;; CHECK: (global $A (ref null $A) (struct.new_default $A)) @@ -31,10 +31,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) ) ;; CHECK: (global $A.desc (ref null (exact $A.desc)) (struct.new_default $A.desc)) @@ -51,9 +51,9 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct))) - (type $A (sub (descriptor $A.desc (struct)))) + (type $A (sub (descriptor $A.desc) (struct))) ;; CHECK: (type $A.desc (sub (struct))) - (type $A.desc (sub (describes $A (struct)))) + (type $A.desc (sub (describes $A) (struct))) ) ;; CHECK: (type $2 (func (param (ref null (exact $A.desc))))) @@ -85,9 +85,9 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct))) - (type $A (sub (descriptor $A.desc (struct)))) + (type $A (sub (descriptor $A.desc) (struct))) ;; CHECK: (type $A.desc (sub (struct))) - (type $A.desc (sub (describes $A (struct)))) + (type $A.desc (sub (describes $A) (struct))) ) ;; CHECK: (type $2 (func (param (ref (exact $A.desc))))) @@ -113,14 +113,14 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) - ;; CHECK: (type $B (sub (descriptor $B.desc (struct)))) - (type $B (sub $A (descriptor $B.desc (struct)))) - ;; CHECK: (type $B.desc (sub (describes $B (struct)))) - (type $B.desc (sub $A.desc (describes $B (struct)))) + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) + ;; CHECK: (type $B (sub (descriptor $B.desc) (struct))) + (type $B (sub $A (descriptor $B.desc) (struct))) + ;; CHECK: (type $B.desc (sub (describes $B) (struct))) + (type $B.desc (sub $A.desc (describes $B) (struct))) ) ;; CHECK: (type $4 (func (param (ref $A) (ref $B)))) @@ -166,13 +166,13 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct))) - (type $A (sub (descriptor $A.desc (struct)))) + (type $A (sub (descriptor $A.desc) (struct))) ;; CHECK: (type $A.desc (sub (struct))) - (type $A.desc (sub (describes $A (struct)))) + (type $A.desc (sub (describes $A) (struct))) ;; CHECK: (type $B (sub $A (struct))) - (type $B (sub $A (descriptor $B.desc (struct)))) + (type $B (sub $A (descriptor $B.desc) (struct))) ;; CHECK: (type $B.desc (sub (struct))) - (type $B.desc (sub $A.desc (describes $B (struct)))) + (type $B.desc (sub $A.desc (describes $B) (struct))) ) ;; CHECK: (global $B (ref null $B) (struct.new_default $B)) @@ -191,14 +191,14 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) - ;; CHECK: (type $B (sub $A (descriptor $B.desc (struct)))) - (type $B (sub $A (descriptor $B.desc (struct)))) - ;; CHECK: (type $B.desc (sub $A.desc (describes $B (struct)))) - (type $B.desc (sub $A.desc (describes $B (struct)))) + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) + ;; CHECK: (type $B (sub $A (descriptor $B.desc) (struct))) + (type $B (sub $A (descriptor $B.desc) (struct))) + ;; CHECK: (type $B.desc (sub $A.desc (describes $B) (struct))) + (type $B.desc (sub $A.desc (describes $B) (struct))) ) ;; CHECK: (type $4 (func (param (ref $A)))) @@ -237,13 +237,13 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct))) - (type $A (sub (descriptor $A.desc (struct)))) + (type $A (sub (descriptor $A.desc) (struct))) ;; CHECK: (type $A.desc (sub (struct))) - (type $A.desc (sub (describes $A (struct)))) - ;; CHECK: (type $B (sub $A (descriptor $B.desc (struct)))) - (type $B (sub $A (descriptor $B.desc (struct)))) - ;; CHECK: (type $B.desc (sub (describes $B (struct)))) - (type $B.desc (sub $A.desc (describes $B (struct)))) + (type $A.desc (sub (describes $A) (struct))) + ;; CHECK: (type $B (sub $A (descriptor $B.desc) (struct))) + (type $B (sub $A (descriptor $B.desc) (struct))) + ;; CHECK: (type $B.desc (sub (describes $B) (struct))) + (type $B.desc (sub $A.desc (describes $B) (struct))) ) ;; CHECK: (type $4 (func (param (ref $B)))) @@ -282,13 +282,13 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $A (sub (struct))) - (type $A (sub (descriptor $A.desc (struct)))) + (type $A (sub (descriptor $A.desc) (struct))) ;; CHECK: (type $A.desc (sub (struct))) - (type $A.desc (sub (describes $A (struct)))) + (type $A.desc (sub (describes $A) (struct))) ;; CHECK: (type $B (sub (struct))) - (type $B (sub $A (descriptor $B.desc (struct)))) + (type $B (sub $A (descriptor $B.desc) (struct))) ;; CHECK: (type $B.desc (sub $A.desc (struct))) - (type $B.desc (sub $A.desc (describes $B (struct)))) + (type $B.desc (sub $A.desc (describes $B) (struct))) ) ;; CHECK: (global $B.desc (ref null $B.desc) (ref.null none)) @@ -307,14 +307,14 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) - ;; CHECK: (type $B (sub $A (descriptor $B.desc (struct)))) - (type $B (sub $A (descriptor $B.desc (struct)))) - ;; CHECK: (type $B.desc (sub $A.desc (describes $B (struct)))) - (type $B.desc (sub $A.desc (describes $B (struct)))) + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) + ;; CHECK: (type $B (sub $A (descriptor $B.desc) (struct))) + (type $B (sub $A (descriptor $B.desc) (struct))) + ;; CHECK: (type $B.desc (sub $A.desc (describes $B) (struct))) + (type $B.desc (sub $A.desc (describes $B) (struct))) ) ;; CHECK: (type $4 (func (param (ref $A)))) @@ -349,14 +349,14 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) - (type $A (sub (descriptor $A.desc (struct)))) - ;; CHECK: (type $A.desc (sub (describes $A (struct)))) - (type $A.desc (sub (describes $A (struct)))) - ;; CHECK: (type $B (sub $A (descriptor $B.desc (struct)))) - (type $B (sub $A (descriptor $B.desc (struct)))) - ;; CHECK: (type $B.desc (sub $A.desc (describes $B (struct)))) - (type $B.desc (sub $A.desc (describes $B (struct)))) + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc) (struct))) + (type $A (sub (descriptor $A.desc) (struct))) + ;; CHECK: (type $A.desc (sub (describes $A) (struct))) + (type $A.desc (sub (describes $A) (struct))) + ;; CHECK: (type $B (sub $A (descriptor $B.desc) (struct))) + (type $B (sub $A (descriptor $B.desc) (struct))) + ;; CHECK: (type $B.desc (sub $A.desc (describes $B) (struct))) + (type $B.desc (sub $A.desc (describes $B) (struct))) ) ;; CHECK: (type $4 (func (param (ref $B)))) @@ -390,14 +390,14 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc (struct)))) - (type $top (sub (descriptor $top.desc (struct)))) - ;; CHECK: (type $bot (sub $top (descriptor $bot.desc (struct)))) - (type $bot (sub $top (descriptor $bot.desc (struct)))) - ;; CHECK: (type $top.desc (sub (describes $top (struct)))) - (type $top.desc (sub (describes $top (struct)))) - ;; CHECK: (type $bot.desc (sub $top.desc (describes $bot (struct)))) - (type $bot.desc (sub $top.desc (describes $bot (struct)))) + ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc) (struct))) + (type $top (sub (descriptor $top.desc) (struct))) + ;; CHECK: (type $bot (sub $top (descriptor $bot.desc) (struct))) + (type $bot (sub $top (descriptor $bot.desc) (struct))) + ;; CHECK: (type $top.desc (sub (describes $top) (struct))) + (type $top.desc (sub (describes $top) (struct))) + ;; CHECK: (type $bot.desc (sub $top.desc (describes $bot) (struct))) + (type $bot.desc (sub $top.desc (describes $bot) (struct))) ) ;; CHECK: (type $4 (func (param anyref (ref $top.desc)))) @@ -431,13 +431,13 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc (struct)))) - (type $top (sub (descriptor $top.desc (struct)))) + ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc) (struct))) + (type $top (sub (descriptor $top.desc) (struct))) ;; CHECK: (type $bot (sub (struct))) - (type $bot (sub $top (descriptor $bot.desc (struct)))) - ;; CHECK: (type $top.desc (sub (describes $top (struct)))) - (type $top.desc (sub (describes $top (struct)))) - (type $bot.desc (sub $top.desc (describes $bot (struct)))) + (type $bot (sub $top (descriptor $bot.desc) (struct))) + ;; CHECK: (type $top.desc (sub (describes $top) (struct))) + (type $top.desc (sub (describes $top) (struct))) + (type $bot.desc (sub $top.desc (describes $bot) (struct))) ) ;; CHECK: (type $3 (func (param anyref (ref (exact $top.desc))))) @@ -469,14 +469,14 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc (struct)))) - (type $top (sub (descriptor $top.desc (struct)))) - ;; CHECK: (type $bot (sub $top (descriptor $bot.desc (struct)))) - (type $bot (sub $top (descriptor $bot.desc (struct)))) - ;; CHECK: (type $top.desc (sub (describes $top (struct)))) - (type $top.desc (sub (describes $top (struct)))) - ;; CHECK: (type $bot.desc (sub $top.desc (describes $bot (struct)))) - (type $bot.desc (sub $top.desc (describes $bot (struct)))) + ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc) (struct))) + (type $top (sub (descriptor $top.desc) (struct))) + ;; CHECK: (type $bot (sub $top (descriptor $bot.desc) (struct))) + (type $bot (sub $top (descriptor $bot.desc) (struct))) + ;; CHECK: (type $top.desc (sub (describes $top) (struct))) + (type $top.desc (sub (describes $top) (struct))) + ;; CHECK: (type $bot.desc (sub $top.desc (describes $bot) (struct))) + (type $bot.desc (sub $top.desc (describes $bot) (struct))) ) ;; CHECK: (type $4 (func (param anyref (ref $top.desc)))) @@ -514,13 +514,13 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc (struct)))) - (type $top (sub (descriptor $top.desc (struct)))) + ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc) (struct))) + (type $top (sub (descriptor $top.desc) (struct))) ;; CHECK: (type $bot (sub (struct))) - (type $bot (sub $top (descriptor $bot.desc (struct)))) - ;; CHECK: (type $top.desc (sub (describes $top (struct)))) - (type $top.desc (sub (describes $top (struct)))) - (type $bot.desc (sub $top.desc (describes $bot (struct)))) + (type $bot (sub $top (descriptor $bot.desc) (struct))) + ;; CHECK: (type $top.desc (sub (describes $top) (struct))) + (type $top.desc (sub (describes $top) (struct))) + (type $bot.desc (sub $top.desc (describes $bot) (struct))) ) ;; CHECK: (type $3 (func (param anyref (ref (exact $top.desc))))) @@ -556,14 +556,14 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc (struct)))) - (type $top (sub (descriptor $top.desc (struct)))) - ;; CHECK: (type $bot (sub $top (descriptor $bot.desc (struct)))) - (type $bot (sub $top (descriptor $bot.desc (struct)))) - ;; CHECK: (type $top.desc (sub (describes $top (struct)))) - (type $top.desc (sub (describes $top (struct)))) - ;; CHECK: (type $bot.desc (sub $top.desc (describes $bot (struct)))) - (type $bot.desc (sub $top.desc (describes $bot (struct)))) + ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc) (struct))) + (type $top (sub (descriptor $top.desc) (struct))) + ;; CHECK: (type $bot (sub $top (descriptor $bot.desc) (struct))) + (type $bot (sub $top (descriptor $bot.desc) (struct))) + ;; CHECK: (type $top.desc (sub (describes $top) (struct))) + (type $top.desc (sub (describes $top) (struct))) + ;; CHECK: (type $bot.desc (sub $top.desc (describes $bot) (struct))) + (type $bot.desc (sub $top.desc (describes $bot) (struct))) ) ;; CHECK: (type $4 (func (param anyref (ref $top.desc)))) @@ -601,13 +601,13 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc (struct)))) - (type $top (sub (descriptor $top.desc (struct)))) + ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc) (struct))) + (type $top (sub (descriptor $top.desc) (struct))) ;; CHECK: (type $bot (sub (struct))) - (type $bot (sub $top (descriptor $bot.desc (struct)))) - ;; CHECK: (type $top.desc (sub (describes $top (struct)))) - (type $top.desc (sub (describes $top (struct)))) - (type $bot.desc (sub $top.desc (describes $bot (struct)))) + (type $bot (sub $top (descriptor $bot.desc) (struct))) + ;; CHECK: (type $top.desc (sub (describes $top) (struct))) + (type $top.desc (sub (describes $top) (struct))) + (type $bot.desc (sub $top.desc (describes $bot) (struct))) ) ;; CHECK: (type $3 (func (param anyref (ref (exact $top.desc))))) @@ -650,18 +650,18 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc (struct)))) - (type $top (sub (descriptor $top.desc (struct)))) - ;; CHECK: (type $mid (sub $top (descriptor $mid.desc (struct)))) - (type $mid (sub $top (descriptor $mid.desc (struct)))) - ;; CHECK: (type $bot (sub $mid (descriptor $bot.desc (struct)))) - (type $bot (sub $mid (descriptor $bot.desc (struct)))) - ;; CHECK: (type $top.desc (sub (describes $top (struct)))) - (type $top.desc (sub (describes $top (struct)))) - ;; CHECK: (type $mid.desc (sub $top.desc (describes $mid (struct)))) - (type $mid.desc (sub $top.desc (describes $mid (struct)))) - ;; CHECK: (type $bot.desc (sub $mid.desc (describes $bot (struct)))) - (type $bot.desc (sub $mid.desc (describes $bot (struct)))) + ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc) (struct))) + (type $top (sub (descriptor $top.desc) (struct))) + ;; CHECK: (type $mid (sub $top (descriptor $mid.desc) (struct))) + (type $mid (sub $top (descriptor $mid.desc) (struct))) + ;; CHECK: (type $bot (sub $mid (descriptor $bot.desc) (struct))) + (type $bot (sub $mid (descriptor $bot.desc) (struct))) + ;; CHECK: (type $top.desc (sub (describes $top) (struct))) + (type $top.desc (sub (describes $top) (struct))) + ;; CHECK: (type $mid.desc (sub $top.desc (describes $mid) (struct))) + (type $mid.desc (sub $top.desc (describes $mid) (struct))) + ;; CHECK: (type $bot.desc (sub $mid.desc (describes $bot) (struct))) + (type $bot.desc (sub $mid.desc (describes $bot) (struct))) ) ;; CHECK: (type $6 (func (param (ref $top)))) @@ -703,18 +703,18 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc (struct)))) - (type $top (sub (descriptor $top.desc (struct)))) - ;; CHECK: (type $mid (sub $top (descriptor $mid.desc (struct)))) - (type $mid (sub $top (descriptor $mid.desc (struct)))) - ;; CHECK: (type $bot (sub $mid (descriptor $bot.desc (struct)))) - (type $bot (sub $mid (descriptor $bot.desc (struct)))) - ;; CHECK: (type $top.desc (sub (describes $top (struct)))) - (type $top.desc (sub (describes $top (struct)))) - ;; CHECK: (type $mid.desc (sub $top.desc (describes $mid (struct)))) - (type $mid.desc (sub $top.desc (describes $mid (struct)))) - ;; CHECK: (type $bot.desc (sub $mid.desc (describes $bot (struct)))) - (type $bot.desc (sub $mid.desc (describes $bot (struct)))) + ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc) (struct))) + (type $top (sub (descriptor $top.desc) (struct))) + ;; CHECK: (type $mid (sub $top (descriptor $mid.desc) (struct))) + (type $mid (sub $top (descriptor $mid.desc) (struct))) + ;; CHECK: (type $bot (sub $mid (descriptor $bot.desc) (struct))) + (type $bot (sub $mid (descriptor $bot.desc) (struct))) + ;; CHECK: (type $top.desc (sub (describes $top) (struct))) + (type $top.desc (sub (describes $top) (struct))) + ;; CHECK: (type $mid.desc (sub $top.desc (describes $mid) (struct))) + (type $mid.desc (sub $top.desc (describes $mid) (struct))) + ;; CHECK: (type $bot.desc (sub $mid.desc (describes $bot) (struct))) + (type $bot.desc (sub $mid.desc (describes $bot) (struct))) ) ;; CHECK: (type $6 (func (param (ref $top)))) @@ -756,17 +756,17 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $top (sub (struct))) - (type $top (sub (descriptor $top.desc (struct)))) - ;; CHECK: (type $mid (sub $top (descriptor $mid.desc (struct)))) - (type $mid (sub $top (descriptor $mid.desc (struct)))) - ;; CHECK: (type $bot (sub $mid (descriptor $bot.desc (struct)))) - (type $bot (sub $mid (descriptor $bot.desc (struct)))) + (type $top (sub (descriptor $top.desc) (struct))) + ;; CHECK: (type $mid (sub $top (descriptor $mid.desc) (struct))) + (type $mid (sub $top (descriptor $mid.desc) (struct))) + ;; CHECK: (type $bot (sub $mid (descriptor $bot.desc) (struct))) + (type $bot (sub $mid (descriptor $bot.desc) (struct))) ;; CHECK: (type $top.desc (sub (struct))) - (type $top.desc (sub (describes $top (struct)))) - ;; CHECK: (type $mid.desc (sub (describes $mid (struct)))) - (type $mid.desc (sub $top.desc (describes $mid (struct)))) - ;; CHECK: (type $bot.desc (sub $mid.desc (describes $bot (struct)))) - (type $bot.desc (sub $mid.desc (describes $bot (struct)))) + (type $top.desc (sub (describes $top) (struct))) + ;; CHECK: (type $mid.desc (sub (describes $mid) (struct))) + (type $mid.desc (sub $top.desc (describes $mid) (struct))) + ;; CHECK: (type $bot.desc (sub $mid.desc (describes $bot) (struct))) + (type $bot.desc (sub $mid.desc (describes $bot) (struct))) ) ;; CHECK: (type $6 (func (param (ref $bot)))) @@ -810,18 +810,18 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc (struct)))) - (type $top (sub (descriptor $top.desc (struct)))) - ;; CHECK: (type $mid (sub $top (descriptor $mid.desc (struct)))) - (type $mid (sub $top (descriptor $mid.desc (struct)))) - ;; CHECK: (type $bot (sub $mid (descriptor $bot.desc (struct)))) - (type $bot (sub $mid (descriptor $bot.desc (struct)))) - ;; CHECK: (type $top.desc (sub (describes $top (struct)))) - (type $top.desc (sub (describes $top (struct)))) - ;; CHECK: (type $mid.desc (sub $top.desc (describes $mid (struct)))) - (type $mid.desc (sub $top.desc (describes $mid (struct)))) - ;; CHECK: (type $bot.desc (sub $mid.desc (describes $bot (struct)))) - (type $bot.desc (sub $mid.desc (describes $bot (struct)))) + ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc) (struct))) + (type $top (sub (descriptor $top.desc) (struct))) + ;; CHECK: (type $mid (sub $top (descriptor $mid.desc) (struct))) + (type $mid (sub $top (descriptor $mid.desc) (struct))) + ;; CHECK: (type $bot (sub $mid (descriptor $bot.desc) (struct))) + (type $bot (sub $mid (descriptor $bot.desc) (struct))) + ;; CHECK: (type $top.desc (sub (describes $top) (struct))) + (type $top.desc (sub (describes $top) (struct))) + ;; CHECK: (type $mid.desc (sub $top.desc (describes $mid) (struct))) + (type $mid.desc (sub $top.desc (describes $mid) (struct))) + ;; CHECK: (type $bot.desc (sub $mid.desc (describes $bot) (struct))) + (type $bot.desc (sub $mid.desc (describes $bot) (struct))) ) ;; CHECK: (type $6 (func (param (ref $top)))) @@ -864,18 +864,18 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc (struct)))) - (type $top (sub (descriptor $top.desc (struct)))) - ;; CHECK: (type $mid (sub $top (descriptor $mid.desc (struct)))) - (type $mid (sub $top (descriptor $mid.desc (struct)))) - ;; CHECK: (type $bot (sub $mid (descriptor $bot.desc (struct)))) - (type $bot (sub $mid (descriptor $bot.desc (struct)))) - ;; CHECK: (type $top.desc (sub (describes $top (struct)))) - (type $top.desc (sub (describes $top (struct)))) - ;; CHECK: (type $mid.desc (sub $top.desc (describes $mid (struct)))) - (type $mid.desc (sub $top.desc (describes $mid (struct)))) - ;; CHECK: (type $bot.desc (sub $mid.desc (describes $bot (struct)))) - (type $bot.desc (sub $mid.desc (describes $bot (struct)))) + ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc) (struct))) + (type $top (sub (descriptor $top.desc) (struct))) + ;; CHECK: (type $mid (sub $top (descriptor $mid.desc) (struct))) + (type $mid (sub $top (descriptor $mid.desc) (struct))) + ;; CHECK: (type $bot (sub $mid (descriptor $bot.desc) (struct))) + (type $bot (sub $mid (descriptor $bot.desc) (struct))) + ;; CHECK: (type $top.desc (sub (describes $top) (struct))) + (type $top.desc (sub (describes $top) (struct))) + ;; CHECK: (type $mid.desc (sub $top.desc (describes $mid) (struct))) + (type $mid.desc (sub $top.desc (describes $mid) (struct))) + ;; CHECK: (type $bot.desc (sub $mid.desc (describes $bot) (struct))) + (type $bot.desc (sub $mid.desc (describes $bot) (struct))) ) ;; CHECK: (type $6 (func (param (ref $top)))) @@ -916,18 +916,18 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc (struct)))) - (type $top (sub (descriptor $top.desc (struct)))) - ;; CHECK: (type $mid (sub $top (descriptor $mid.desc (struct)))) - (type $mid (sub $top (descriptor $mid.desc (struct)))) - ;; CHECK: (type $bot (sub $mid (descriptor $bot.desc (struct)))) - (type $bot (sub $mid (descriptor $bot.desc (struct)))) - ;; CHECK: (type $top.desc (sub (describes $top (struct)))) - (type $top.desc (sub (describes $top (struct)))) - ;; CHECK: (type $mid.desc (sub $top.desc (describes $mid (struct)))) - (type $mid.desc (sub $top.desc (describes $mid (struct)))) - ;; CHECK: (type $bot.desc (sub $mid.desc (describes $bot (struct)))) - (type $bot.desc (sub $mid.desc (describes $bot (struct)))) + ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc) (struct))) + (type $top (sub (descriptor $top.desc) (struct))) + ;; CHECK: (type $mid (sub $top (descriptor $mid.desc) (struct))) + (type $mid (sub $top (descriptor $mid.desc) (struct))) + ;; CHECK: (type $bot (sub $mid (descriptor $bot.desc) (struct))) + (type $bot (sub $mid (descriptor $bot.desc) (struct))) + ;; CHECK: (type $top.desc (sub (describes $top) (struct))) + (type $top.desc (sub (describes $top) (struct))) + ;; CHECK: (type $mid.desc (sub $top.desc (describes $mid) (struct))) + (type $mid.desc (sub $top.desc (describes $mid) (struct))) + ;; CHECK: (type $bot.desc (sub $mid.desc (describes $bot) (struct))) + (type $bot.desc (sub $mid.desc (describes $bot) (struct))) ) ;; CHECK: (type $6 (func (param (ref $bot)))) @@ -972,18 +972,18 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc (struct)))) - (type $top (sub (descriptor $top.desc (struct)))) - ;; CHECK: (type $mid (sub $top (descriptor $mid.desc (struct)))) - (type $mid (sub $top (descriptor $mid.desc (struct)))) - ;; CHECK: (type $bot (sub $mid (descriptor $bot.desc (struct)))) - (type $bot (sub $mid (descriptor $bot.desc (struct)))) - ;; CHECK: (type $top.desc (sub (describes $top (struct)))) - (type $top.desc (sub (describes $top (struct)))) - ;; CHECK: (type $mid.desc (sub $top.desc (describes $mid (struct)))) - (type $mid.desc (sub $top.desc (describes $mid (struct)))) - ;; CHECK: (type $bot.desc (sub $mid.desc (describes $bot (struct)))) - (type $bot.desc (sub $mid.desc (describes $bot (struct)))) + ;; CHECK-NEXT: (type $top (sub (descriptor $top.desc) (struct))) + (type $top (sub (descriptor $top.desc) (struct))) + ;; CHECK: (type $mid (sub $top (descriptor $mid.desc) (struct))) + (type $mid (sub $top (descriptor $mid.desc) (struct))) + ;; CHECK: (type $bot (sub $mid (descriptor $bot.desc) (struct))) + (type $bot (sub $mid (descriptor $bot.desc) (struct))) + ;; CHECK: (type $top.desc (sub (describes $top) (struct))) + (type $top.desc (sub (describes $top) (struct))) + ;; CHECK: (type $mid.desc (sub $top.desc (describes $mid) (struct))) + (type $mid.desc (sub $top.desc (describes $mid) (struct))) + ;; CHECK: (type $bot.desc (sub $mid.desc (describes $bot) (struct))) + (type $bot.desc (sub $mid.desc (describes $bot) (struct))) ;; CHECK: (type $X (sub (struct (field (ref null $mid.desc))))) (type $X (sub (struct (field (ref null $mid.desc))))) ;; CHECK: (type $Y (sub $X (struct (field (ref null $bot.desc))))) @@ -1029,9 +1029,9 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (struct)) - (type $struct (descriptor $desc (struct))) + (type $struct (descriptor $desc) (struct)) ;; CHECK: (type $desc (struct)) - (type $desc (describes $struct (struct))) + (type $desc (describes $struct) (struct)) ) ;; CHECK: (type $2 (func)) @@ -1125,10 +1125,10 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (descriptor $desc (struct))) - (type $struct (descriptor $desc (struct))) - ;; CHECK: (type $desc (describes $struct (struct))) - (type $desc (describes $struct (struct))) + ;; CHECK-NEXT: (type $struct (descriptor $desc) (struct)) + (type $struct (descriptor $desc) (struct)) + ;; CHECK: (type $desc (describes $struct) (struct)) + (type $desc (describes $struct) (struct)) ) ;; CHECK: (type $2 (func)) @@ -1171,11 +1171,11 @@ (rec ;; CHECK: (rec ;; CHECK-NEXT: (type $struct (sub (struct))) - (type $struct (sub (descriptor $desc (struct)))) - ;; CHECK: (type $desc (sub (descriptor $meta (struct)))) - (type $desc (sub (describes $struct (descriptor $meta (struct))))) - ;; CHECK: (type $meta (sub (describes $desc (struct)))) - (type $meta (sub (describes $desc (struct)))) + (type $struct (sub (descriptor $desc) (struct))) + ;; CHECK: (type $desc (sub (descriptor $meta) (struct))) + (type $desc (sub (describes $struct) (descriptor $meta) (struct))) + ;; CHECK: (type $meta (sub (describes $desc) (struct))) + (type $meta (sub (describes $desc) (struct))) ) ;; CHECK: (global $g (ref $struct) (struct.new_default $struct)) @@ -1192,11 +1192,11 @@ ;; CHECK-NEXT: (type $A (sub (struct (field (ref $struct))))) (type $A (sub (struct (field (ref $struct))))) ;; CHECK: (type $struct (sub (struct))) - (type $struct (sub (descriptor $desc (struct)))) - ;; CHECK: (type $desc (sub (descriptor $meta (struct)))) - (type $desc (sub (describes $struct (descriptor $meta (struct))))) - ;; CHECK: (type $meta (sub (describes $desc (struct)))) - (type $meta (sub (describes $desc (struct)))) + (type $struct (sub (descriptor $desc) (struct))) + ;; CHECK: (type $desc (sub (descriptor $meta) (struct))) + (type $desc (sub (describes $struct) (descriptor $meta) (struct))) + ;; CHECK: (type $meta (sub (describes $desc) (struct))) + (type $meta (sub (describes $desc) (struct))) ) ;; CHECK: (global $g (ref $A) (struct.new $A @@ -1214,10 +1214,10 @@ ;; unreachable code first. (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (sub (descriptor $desc (struct)))) - (type $struct (sub (descriptor $desc (struct)))) - ;; CHECK: (type $desc (sub (describes $struct (struct)))) - (type $desc (sub (describes $struct (struct)))) + ;; CHECK-NEXT: (type $struct (sub (descriptor $desc) (struct))) + (type $struct (sub (descriptor $desc) (struct))) + ;; CHECK: (type $desc (sub (describes $struct) (struct))) + (type $desc (sub (describes $struct) (struct))) ) ;; CHECK: (type $2 (func)) diff --git a/test/lit/passes/vacuum-desc.wast b/test/lit/passes/vacuum-desc.wast index 912d61c3567..8574e59cb47 100644 --- a/test/lit/passes/vacuum-desc.wast +++ b/test/lit/passes/vacuum-desc.wast @@ -7,16 +7,16 @@ (module (rec ;; CHECK: (rec - ;; CHECK-NEXT: (type $struct (descriptor $desc (struct))) + ;; CHECK-NEXT: (type $struct (descriptor $desc) (struct)) ;; CKIIT: (rec - ;; CKIIT-NEXT: (type $struct (descriptor $desc (struct))) + ;; CKIIT-NEXT: (type $struct (descriptor $desc) (struct)) ;; CKTNH: (rec - ;; CKTNH-NEXT: (type $struct (descriptor $desc (struct))) - (type $struct (descriptor $desc (struct))) - ;; CHECK: (type $desc (describes $struct (struct))) - ;; CKIIT: (type $desc (describes $struct (struct))) - ;; CKTNH: (type $desc (describes $struct (struct))) - (type $desc (describes $struct (struct))) + ;; CKTNH-NEXT: (type $struct (descriptor $desc) (struct)) + (type $struct (descriptor $desc) (struct)) + ;; CHECK: (type $desc (describes $struct) (struct)) + ;; CKIIT: (type $desc (describes $struct) (struct)) + ;; CKTNH: (type $desc (describes $struct) (struct)) + (type $desc (describes $struct) (struct)) ) ;; CHECK: (func $new-null-desc (type $5) (param $desc nullref) diff --git a/test/lit/validation/unused-descriptors.wast b/test/lit/validation/unused-descriptors.wast index 7b16840e72e..0ba8f8aee78 100644 --- a/test/lit/validation/unused-descriptors.wast +++ b/test/lit/validation/unused-descriptors.wast @@ -12,8 +12,8 @@ (module (rec - (type $struct (descriptor $desc (struct))) - (type $desc (describes $struct (struct))) + (type $struct (descriptor $desc) (struct)) + (type $desc (describes $struct) (struct)) (type $used (struct)) ) diff --git a/test/spec/br_on_cast_desc.wast b/test/spec/br_on_cast_desc.wast index beddf74950e..b6465e008c1 100644 --- a/test/spec/br_on_cast_desc.wast +++ b/test/spec/br_on_cast_desc.wast @@ -1,10 +1,10 @@ (module (rec - (type $super (sub (descriptor $super.desc (struct)))) - (type $super.desc (sub (describes $super (struct)))) + (type $super (sub (descriptor $super.desc) (struct))) + (type $super.desc (sub (describes $super) (struct))) - (type $sub (sub $super (descriptor $sub.desc (struct)))) - (type $sub.desc (sub $super.desc (describes $sub (struct)))) + (type $sub (sub $super (descriptor $sub.desc) (struct))) + (type $sub.desc (sub $super.desc (describes $sub) (struct))) ) (global $super.desc1 (ref (exact $super.desc)) (struct.new $super.desc)) @@ -229,13 +229,13 @@ (assert_malformed ;; Input type must be a reference. - (module quote "(module (rec (type $struct (descriptor $desc (struct))) (type $desc (describes $struct (struct)))) (func (result anyref) (unreachable) (br_on_cast_desc 0 i32 (ref null $struct))))") + (module quote "(module (rec (type $struct (descriptor $desc) (struct)) (type $desc (describes $struct) (struct))) (func (result anyref) (unreachable) (br_on_cast_desc 0 i32 (ref null $struct))))") "expected reftype" ) (assert_malformed ;; Input type must be a reference. - (module quote "(module (rec (type $struct (descriptor $desc (struct))) (type $desc (describes $struct (struct)))) (func (result anyref) (unreachable) (br_on_cast_desc_fail 0 i32 (ref null $struct))))") + (module quote "(module (rec (type $struct (descriptor $desc) (struct)) (type $desc (describes $struct) (struct))) (func (result anyref) (unreachable) (br_on_cast_desc_fail 0 i32 (ref null $struct))))") "expected reftype" ) @@ -295,8 +295,8 @@ (assert_invalid (module (rec - (type $struct (descriptor $desc (struct))) - (type $desc (describes $struct (struct))) + (type $struct (descriptor $desc) (struct)) + (type $desc (describes $struct) (struct)) ) (func (param anyref) (result anyref) (br_on_cast_desc_fail 0 eqref (ref null $struct) @@ -312,11 +312,11 @@ (assert_invalid (module (rec - (type $super (sub (descriptor $super.desc (struct)))) - (type $super.desc (sub (describes $super (struct)))) + (type $super (sub (descriptor $super.desc) (struct))) + (type $super.desc (sub (describes $super) (struct))) - (type $sub (sub $super (descriptor $sub.desc (struct)))) - (type $sub.desc (sub $super.desc (describes $sub (struct)))) + (type $sub (sub $super (descriptor $sub.desc) (struct))) + (type $sub.desc (sub $super.desc (describes $sub) (struct))) ) (func (param $any anyref) (param $super.desc (ref null $super.desc)) (result anyref) (br_on_cast_desc 0 anyref (ref null $sub) @@ -332,11 +332,11 @@ (assert_invalid (module (rec - (type $super (sub (descriptor $super.desc (struct)))) - (type $super.desc (sub (describes $super (struct)))) + (type $super (sub (descriptor $super.desc) (struct))) + (type $super.desc (sub (describes $super) (struct))) - (type $sub (sub $super (descriptor $sub.desc (struct)))) - (type $sub.desc (sub $super.desc (describes $sub (struct)))) + (type $sub (sub $super (descriptor $sub.desc) (struct))) + (type $sub.desc (sub $super.desc (describes $sub) (struct))) ) (func (param $any anyref) (param $super.desc (ref null $super.desc)) (result anyref) (br_on_cast_desc_fail 0 anyref (ref null $sub) @@ -352,8 +352,8 @@ (assert_invalid (module (rec - (type $struct (descriptor $desc (struct))) - (type $desc (describes $struct (struct))) + (type $struct (descriptor $desc) (struct)) + (type $desc (describes $struct) (struct)) ) (func (param $any anyref) (param $desc (ref null $desc)) (result (ref null (exact $struct))) ;; The sent type cannnot be exact because the descriptor is not exact. @@ -370,8 +370,8 @@ (assert_invalid (module (rec - (type $struct (descriptor $desc (struct))) - (type $desc (describes $struct (struct))) + (type $struct (descriptor $desc) (struct)) + (type $desc (describes $struct) (struct)) ) (func (param $any anyref) (param $desc (ref null $desc)) (result anyref) (block (result (ref null (exact $struct))) diff --git a/test/spec/descriptors.wast b/test/spec/descriptors.wast index 580d7d07cfe..633ca7d20c0 100644 --- a/test/spec/descriptors.wast +++ b/test/spec/descriptors.wast @@ -1,14 +1,14 @@ (module (rec - (type (descriptor 1 (struct))) - (type (describes 0 (struct))) + (type (descriptor 1) (struct)) + (type (describes 0) (struct)) ) ) (assert_invalid (module (rec - (type (descriptor 1 (struct))) + (type (descriptor 1) (struct)) (type (struct)) ) ) @@ -20,7 +20,7 @@ (module (rec (type (struct)) - (type (describes 0 (struct))) + (type (describes 0) (struct)) ) ) "describes with no matching descriptor" @@ -29,8 +29,8 @@ (assert_invalid (module (rec - (type (describes 1 (struct))) - (type (descriptor 0 (struct))) + (type (describes 1) (struct)) + (type (descriptor 0) (struct)) ) ) "forward describes reference" @@ -39,8 +39,8 @@ (assert_invalid (module (rec - (type (descriptor 1 (array i8))) - (type (describes 0 (struct))) + (type (descriptor 1) (array i8)) + (type (describes 0) (struct)) ) ) "descriptor clause on non-struct type" @@ -49,8 +49,8 @@ (assert_invalid (module (rec - (type (descriptor 1 (struct))) - (type (describes 0 (array i8))) + (type (descriptor 1) (struct)) + (type (describes 0) (array i8)) ) ) "describes clause on non-struct type" @@ -58,16 +58,16 @@ (module (rec - (type (shared (descriptor 1 (struct)))) - (type (shared (describes 0 (struct)))) + (type (shared (descriptor 1) (struct))) + (type (shared (describes 0) (struct))) ) ) (assert_invalid (module (rec - (type (shared (descriptor 1 (struct)))) - (type (describes 0 (struct))) + (type (shared (descriptor 1) (struct))) + (type (describes 0) (struct)) ) ) "unshared descriptor type" @@ -77,8 +77,8 @@ (assert_invalid (module (rec - (type (descriptor 1 (struct))) - (type (shared (describes 0 (struct)))) + (type (descriptor 1) (struct)) + (type (shared (describes 0) (struct))) ) ) "unshared described types" @@ -86,12 +86,12 @@ (module (rec - (type $super (sub (descriptor $super-desc (struct)))) - (type $super-desc (sub (describes $super (struct)))) + (type $super (sub (descriptor $super-desc) (struct))) + (type $super-desc (sub (describes $super) (struct))) ) (rec - (type $sub (sub $super (descriptor $sub-desc (struct)))) - (type $sub-desc (sub $super-desc (describes $sub (struct)))) + (type $sub (sub $super (descriptor $sub-desc) (struct))) + (type $sub-desc (sub $super-desc (describes $sub) (struct))) ) ) @@ -99,12 +99,12 @@ (module (type $super (sub (struct))) (rec - (type $other (sub (descriptor $super-desc (struct)))) - (type $super-desc (sub (describes $other (struct)))) + (type $other (sub (descriptor $super-desc) (struct))) + (type $super-desc (sub (describes $other) (struct))) ) (rec - (type $sub (sub $super (descriptor $sub-desc (struct)))) - (type $sub-desc (sub $super-desc (describes $sub (struct)))) + (type $sub (sub $super (descriptor $sub-desc) (struct))) + (type $sub-desc (sub $super-desc (describes $sub) (struct))) ) ) "supertype of descriptor type must describe supertype of described type" @@ -115,8 +115,8 @@ (type $super (sub (struct))) (type $super-desc (sub (struct))) (rec - (type $sub (sub $super (descriptor $sub-desc (struct)))) - (type $sub-desc (sub $super-desc (describes $sub (struct)))) + (type $sub (sub $super (descriptor $sub-desc) (struct))) + (type $sub-desc (sub $super-desc (describes $sub) (struct))) ) ) "supertype of descriptor must be a descriptor" @@ -125,14 +125,14 @@ (assert_invalid (module (rec - (type $other (sub (descriptor $super-desc (struct)))) - (type $super-desc (sub (describes $other (struct)))) - (type $super (sub (descriptor $other-desc (struct)))) - (type $other-desc (sub (describes $super (struct)))) + (type $other (sub (descriptor $super-desc) (struct))) + (type $super-desc (sub (describes $other) (struct))) + (type $super (sub (descriptor $other-desc) (struct))) + (type $other-desc (sub (describes $super) (struct))) ) (rec - (type $sub (sub $super (descriptor $sub-desc (struct)))) - (type $sub-desc (sub $super-desc (describes $sub (struct)))) + (type $sub (sub $super (descriptor $sub-desc) (struct))) + (type $sub-desc (sub $super-desc (describes $sub) (struct))) ) ) "supertype of described type must be described by supertype of descriptor" @@ -141,8 +141,8 @@ (assert_invalid (module (rec - (type $super (sub (descriptor $super-desc (struct)))) - (type $super-desc (sub (describes $super (struct)))) + (type $super (sub (descriptor $super-desc) (struct))) + (type $super-desc (sub (describes $super) (struct))) ) (type $sub (sub $super (struct))) ) @@ -152,8 +152,8 @@ (assert_invalid (module (rec - (type $super (sub (descriptor $super-desc (struct)))) - (type $super-desc (sub (describes $super (struct)))) + (type $super (sub (descriptor $super-desc) (struct))) + (type $super-desc (sub (describes $super) (struct))) ) (type $sub (sub $super-desc (struct))) ) diff --git a/test/spec/ref.cast_desc.wast b/test/spec/ref.cast_desc.wast index 6fc2710310f..8251df0bccf 100644 --- a/test/spec/ref.cast_desc.wast +++ b/test/spec/ref.cast_desc.wast @@ -1,10 +1,10 @@ (module (rec - (type $super (sub (descriptor $super.desc (struct)))) - (type $super.desc (sub (describes $super (struct)))) + (type $super (sub (descriptor $super.desc) (struct))) + (type $super.desc (sub (describes $super) (struct))) - (type $sub (sub $super (descriptor $sub.desc (struct)))) - (type $sub.desc (sub $super.desc (describes $sub (struct)))) + (type $sub (sub $super (descriptor $sub.desc) (struct))) + (type $sub.desc (sub $super.desc (describes $sub) (struct))) ) (global $super.desc1 (ref (exact $super.desc)) (struct.new $super.desc)) @@ -222,11 +222,11 @@ (assert_invalid (module (rec - (type $super (sub (descriptor $super.desc (struct)))) - (type $super.desc (sub (describes $super (struct)))) + (type $super (sub (descriptor $super.desc) (struct))) + (type $super.desc (sub (describes $super) (struct))) - (type $sub (sub $super (descriptor $sub.desc (struct)))) - (type $sub.desc (sub $super.desc (describes $sub (struct)))) + (type $sub (sub $super (descriptor $sub.desc) (struct))) + (type $sub.desc (sub $super.desc (describes $sub) (struct))) ) (func (param $super.desc (ref null $super.desc)) (result anyref) (ref.cast_desc (ref null $sub) @@ -242,11 +242,11 @@ (assert_invalid (module (rec - (type $super (sub (descriptor $super.desc (struct)))) - (type $super.desc (sub (describes $super (struct)))) + (type $super (sub (descriptor $super.desc) (struct))) + (type $super.desc (sub (describes $super) (struct))) - (type $sub (sub $super (descriptor $sub.desc (struct)))) - (type $sub.desc (sub $super.desc (describes $sub (struct)))) + (type $sub (sub $super (descriptor $sub.desc) (struct))) + (type $sub.desc (sub $super.desc (describes $sub) (struct))) ) (func (param $super.desc (ref null $super.desc)) (result anyref) (ref.cast_desc (ref $sub) @@ -262,8 +262,8 @@ (assert_invalid (module (rec - (type $struct (descriptor $desc (struct))) - (type $desc (describes $struct (struct))) + (type $struct (descriptor $desc) (struct)) + (type $desc (describes $struct) (struct)) ) (func (param $any anyref) (param $desc (ref null $desc)) (result anyref) ;; The cast type cannot be exact because the descriptor is not exact. @@ -279,8 +279,8 @@ (assert_invalid (module (rec - (type $struct (descriptor $desc (struct))) - (type $desc (describes $struct (struct))) + (type $struct (descriptor $desc) (struct)) + (type $desc (describes $struct) (struct)) ) (func (param $any anyref) (param $desc (ref null $desc)) (result anyref) ;; The cast type cannot be exact because the descriptor is not exact. diff --git a/test/spec/ref.get_desc.wast b/test/spec/ref.get_desc.wast index b5d21855fc6..adfec871912 100644 --- a/test/spec/ref.get_desc.wast +++ b/test/spec/ref.get_desc.wast @@ -1,7 +1,7 @@ (module (rec - (type $struct (descriptor $desc (struct))) - (type $desc (describes $struct (struct))) + (type $struct (descriptor $desc) (struct)) + (type $desc (describes $struct) (struct)) ) (global $desc1 (ref (exact $desc)) (struct.new $desc)) @@ -51,8 +51,8 @@ (assert_invalid (module (rec - (type $struct (descriptor $desc (struct))) - (type $desc (describes $struct (struct))) + (type $struct (descriptor $desc) (struct)) + (type $desc (describes $struct) (struct)) ) (func (param $struct (ref null $struct)) (result (ref (exact $desc))) ;; The result is not exact if the input is not exact. diff --git a/test/spec/struct.new-desc.wast b/test/spec/struct.new-desc.wast index 00698c66359..299d48e592b 100644 --- a/test/spec/struct.new-desc.wast +++ b/test/spec/struct.new-desc.wast @@ -1,7 +1,7 @@ (module (rec - (type $pair (descriptor $pair.desc (struct (field i32 i64)))) - (type $pair.desc (describes $pair (struct))) + (type $pair (descriptor $pair.desc) (struct (field i32 i64))) + (type $pair.desc (describes $pair) (struct)) ) (func $struct.new (param $desc (ref null (exact $pair.desc))) (result (ref (exact $pair))) (struct.new $pair @@ -47,8 +47,8 @@ (assert_invalid (module (rec - (type $pair (descriptor $pair.desc (struct (field i32 i64)))) - (type $pair.desc (describes $pair (struct))) + (type $pair (descriptor $pair.desc) (struct (field i32 i64))) + (type $pair.desc (describes $pair) (struct)) ) (func (result (ref (exact $pair))) ;; The descriptor operand is missing. @@ -64,8 +64,8 @@ (assert_invalid (module (rec - (type $pair (descriptor $pair.desc (struct (field i32 i64)))) - (type $pair.desc (describes $pair (struct))) + (type $pair (descriptor $pair.desc) (struct (field i32 i64))) + (type $pair.desc (describes $pair) (struct)) ) (func (result (ref (exact $pair))) The descriptor operand is missing. @@ -78,8 +78,8 @@ (assert_invalid (module (rec - (type $pair (descriptor $pair.desc (struct (field i32 i64)))) - (type $pair.desc (describes $pair (struct))) + (type $pair (descriptor $pair.desc) (struct (field i32 i64))) + (type $pair.desc (describes $pair) (struct)) ) (func (result (ref (exact $pair))) ;; The descriptor needs to be exact. @@ -97,8 +97,8 @@ (assert_invalid (module (rec - (type $pair (descriptor $pair.desc (struct (field i32 i64)))) - (type $pair.desc (describes $pair (struct))) + (type $pair (descriptor $pair.desc) (struct (field i32 i64))) + (type $pair.desc (describes $pair) (struct)) ) (func (result (ref (exact $pair))) ;; The descriptor needs to be exact. @@ -114,8 +114,8 @@ (assert_invalid (module (rec - (type $pair (descriptor $pair.desc (struct (field i32 i64)))) - (type $pair.desc (describes $pair (struct))) + (type $pair (descriptor $pair.desc) (struct (field i32 i64))) + (type $pair.desc (describes $pair) (struct)) (type $other (struct)) ) (func (result (ref (exact $pair))) @@ -133,8 +133,8 @@ (assert_invalid (module (rec - (type $pair (descriptor $pair.desc (struct (field i32 i64)))) - (type $pair.desc (describes $pair (struct))) + (type $pair (descriptor $pair.desc) (struct (field i32 i64))) + (type $pair.desc (describes $pair) (struct)) (type $other (struct)) ) (func (result (ref (exact $pair)))