Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/wasm/wasm-type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2109,10 +2109,6 @@ TypePrinter::print(const Struct& struct_,
print(struct_.fields[i]);
os << ')';
}
// TODO: Remove this extra space kept to minimize test diffs.
if (struct_.fields.size() == 0) {
os << ' ';
}
return os << ")";
}

Expand Down
4 changes: 2 additions & 2 deletions test/example/typeinfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ i31
i31ref
(ref i31)
(func)
(type $struct.0 (struct ))
(type $struct.0 (struct))
(type $array.0 (array i32))

;; Signature
Expand All @@ -24,7 +24,7 @@ i31ref
(ref null $func.0)

;; Struct
(type $struct.0 (struct ))
(type $struct.0 (struct))
(ref $struct.0)
(ref null $struct.0)
(type $struct.0 (struct (field i32) (field i64) (field (mut f32)) (field (mut f64))))
Expand Down
4 changes: 2 additions & 2 deletions test/lit/basic/shared-types.wast
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
;; CHECK: (type $0 (func))

;; CHECK: (rec
;; CHECK-NEXT: (type $final (shared (struct )))
;; CHECK-NEXT: (type $final (shared (struct)))
(type $final (shared (struct)))
;; CHECK: (type $top (sub (shared (struct ))))
;; CHECK: (type $top (sub (shared (struct))))
(type $top (sub (shared (struct))))
;; CHECK: (type $mid (sub $top (shared (struct (field i32)))))
(type $mid (sub $top (shared (struct i32))))
Expand Down
4 changes: 2 additions & 2 deletions test/lit/cast-and-recast-tuple.wast
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
(module
(rec
;; CHECK: (rec
;; CHECK-NEXT: (type $A (sub (struct )))
;; CHECK-NEXT: (type $A (sub (struct)))
(type $A (sub (struct)))
;; CHECK: (type $B (sub $A (struct )))
;; CHECK: (type $B (sub $A (struct)))
(type $B (sub $A (struct)))
)

Expand Down
6 changes: 3 additions & 3 deletions test/lit/cast-and-recast.wast
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
(module
(rec
;; CHECK: (rec
;; CHECK-NEXT: (type $A (sub (struct )))
;; CHECK-NEXT: (type $A (sub (struct)))
(type $A (sub (struct)))
;; CHECK: (type $B (sub $A (struct )))
;; CHECK: (type $B (sub $A (struct)))
(type $B (sub $A (struct)))
;; CHECK: (type $C (sub $B (struct )))
;; CHECK: (type $C (sub $B (struct)))
(type $C (sub $B (struct)))
)

Expand Down
4 changes: 2 additions & 2 deletions test/lit/ctor-eval/ctor_after_serialization.wat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;; contains the serialization of the struct.new instruction).

(module
;; CHECK: (type $A (struct ))
;; CHECK: (type $A (struct))
(type $A (struct))

(export "new" (func $new))
Expand Down Expand Up @@ -43,7 +43,7 @@
;; As above, but now there is an existing global with the name that we want to
;; use. We should not collide.

;; CHECK: (type $A (struct ))
;; CHECK: (type $A (struct))
(type $A (struct))

;; CHECK: (type $1 (func (result (ref any))))
Expand Down
2 changes: 1 addition & 1 deletion test/lit/empty-elem.wast
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
;; type, resulting in invalid modules.

(module
;; CHECK: (type $struct (sub (struct )))
;; CHECK: (type $struct (sub (struct)))
(type $struct (sub (struct)))

;; CHECK: (type $array (sub (array (mut (ref null $struct)))))
Expand Down
4 changes: 2 additions & 2 deletions test/lit/fuzz-types.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
;; CHECK-NEXT: (type $0 (sub (struct (field (mut i16)) (field (mut (ref $2))) (field (mut (ref null $2))))))
;; CHECK-NEXT: (type $1 (sub (func (param (ref $1)) (result f64 (ref $0) f32 (ref null (shared eq))))))
;; CHECK-NEXT: (type $2 (sub (shared (struct (field (mut (ref null (shared extern)))) (field (mut (ref null $2)))))))
;; CHECK-NEXT: (type $3 (sub (shared (struct ))))
;; CHECK-NEXT: (type $3 (sub (shared (struct))))
;; CHECK-NEXT: )
;; CHECK-NEXT: (rec
;; CHECK-NEXT: (type $4 (sub (array i32)))
Expand Down Expand Up @@ -36,7 +36,7 @@
;; CHECK-NEXT: (type $0 (sub (struct (field (mut i16)) (field (mut (ref $2))) (field (mut (ref null $2))))))
;; CHECK-NEXT: (type $1 (sub (func (param (ref $1)) (result f64 (ref $0) f32 (ref null (shared eq))))))
;; CHECK-NEXT: (type $2 (sub (shared (struct (field (mut (ref null (shared extern)))) (field (mut (ref null $2)))))))
;; CHECK-NEXT: (type $3 (sub (shared (struct ))))
;; CHECK-NEXT: (type $3 (sub (shared (struct)))
;; CHECK-NEXT: )
;; CHECK-NEXT: (rec
;; CHECK-NEXT: (type $4 (sub (array i32)))
Expand Down
2 changes: 1 addition & 1 deletion test/lit/global-only.wast
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
;; RUN: wasm-opt -all %s -S -o - | filecheck %s

(module $parse
;; CHECK: (type $t (struct ))
;; CHECK: (type $t (struct))
(type $t (struct))
;; CHECK: (global $g (ref null $t) (ref.null none))
(global $g (ref null $t) (ref.null $t))
Expand Down
2 changes: 1 addition & 1 deletion test/lit/isorecursive-good.wast
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
(type $final-func (sub final $sub-func (func (param (ref $super-array)) (result (ref $final-array)))))
)

;; CHECK: (type $final-root (struct ))
;; CHECK: (type $final-root (struct))
(type $final-root (sub final (struct)))

;; CHECK: (func $make-super-struct (type $6) (result (ref $super-struct))
Expand Down
30 changes: 15 additions & 15 deletions test/lit/isorecursive-output-ordering.wast
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@

(rec
;; CHECK: (rec
;; CHECK-NEXT: (type $unused-6 (sub (struct )))
;; CHECK-NEXT: (type $unused-6 (sub (struct)))

;; CHECK: (type $used-a-bit (sub (struct )))
;; CHECK: (type $used-a-bit (sub (struct)))

;; CHECK: (rec
;; CHECK-NEXT: (type $unused-1 (sub (struct )))
;; CHECK-NEXT: (type $unused-1 (sub (struct)))
(type $unused-1 (sub (struct)))
;; CHECK: (type $unused-2 (sub (struct )))
;; CHECK: (type $unused-2 (sub (struct)))
(type $unused-2 (sub (struct)))
;; CHECK: (type $unused-3 (sub (struct )))
;; CHECK: (type $unused-3 (sub (struct)))
(type $unused-3 (sub (struct)))
;; CHECK: (type $unused-4 (sub (struct )))
;; CHECK: (type $unused-4 (sub (struct)))
(type $unused-4 (sub (struct)))
;; CHECK: (type $used-a-lot (sub (struct )))
;; CHECK: (type $used-a-lot (sub (struct)))
(type $used-a-lot (sub (struct)))
;; CHECK: (type $unused-5 (sub (struct )))
;; CHECK: (type $unused-5 (sub (struct)))
(type $unused-5 (sub (struct)))
)

Expand All @@ -47,20 +47,20 @@

(rec
;; CHECK: (rec
;; CHECK-NEXT: (type $leaf (sub (struct )))
;; CHECK-NEXT: (type $leaf (sub (struct)))
(type $leaf (sub (struct)))
;; CHECK: (type $unused (sub (struct )))
;; CHECK: (type $unused (sub (struct)))
(type $unused (sub (struct)))
)

(rec
;; CHECK: (rec
;; CHECK-NEXT: (type $shrub (sub $leaf (struct )))
;; CHECK-NEXT: (type $shrub (sub $leaf (struct)))

;; CHECK: (type $used-a-ton (sub (struct )))
;; CHECK: (type $used-a-ton (sub (struct)))

;; CHECK: (rec
;; CHECK-NEXT: (type $twig (sub (struct )))
;; CHECK-NEXT: (type $twig (sub (struct)))
(type $twig (sub (struct)))
;; CHECK: (type $used-a-bit (sub (struct (field (ref $leaf)))))
(type $used-a-bit (sub (struct (ref $leaf))))
Expand All @@ -73,9 +73,9 @@

(rec
;; CHECK: (rec
;; CHECK-NEXT: (type $root (sub (struct )))
;; CHECK-NEXT: (type $root (sub (struct)))
(type $root (sub (struct)))
;; CHECK: (type $used-a-lot (sub $twig (struct )))
;; CHECK: (type $used-a-lot (sub $twig (struct)))
(type $used-a-lot (sub $twig (struct)))
)

Expand Down
2 changes: 1 addition & 1 deletion test/lit/isorecursive-singleton-group.wast
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


(rec
;; CHECK: (type $singleton (sub (struct )))
;; CHECK: (type $singleton (sub (struct)))
(type $singleton (sub (struct)))
)

Expand Down
4 changes: 2 additions & 2 deletions test/lit/isorecursive-whole-group.wast
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
(module
(rec
;; CHECK: (rec
;; CHECK-NEXT: (type $used (sub (struct )))
;; CHECK-NEXT: (type $used (sub (struct)))
(type $used (sub (struct)))
;; CHECK: (type $unused (sub (struct )))
;; CHECK: (type $unused (sub (struct)))
(type $unused (sub (struct)))
)

Expand Down
50 changes: 25 additions & 25 deletions test/lit/passes/abstract-type-refining.wast
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@
;; NO_TNH: (rec
;; NO_TNH-NEXT: (type $0 (func))

;; NO_TNH: (type $A (sub (struct )))
;; NO_TNH: (type $A (sub (struct)))
(type $A (sub (struct)))

;; YESTNH: (rec
;; YESTNH-NEXT: (type $0 (func))

;; YESTNH: (type $B (sub (struct )))
;; NO_TNH: (type $B (sub $A (struct )))
;; YESTNH: (type $B (sub (struct)))
;; NO_TNH: (type $B (sub $A (struct)))
(type $B (sub $A (struct)))

;; YESTNH: (type $C (sub $B (struct )))
;; NO_TNH: (type $C (sub $B (struct )))
;; YESTNH: (type $C (sub $B (struct)))
;; NO_TNH: (type $C (sub $B (struct)))
(type $C (sub $B (struct)))

;; NO_TNH: (type $D (sub $C (struct )))
;; NO_TNH: (type $D (sub $C (struct)))
(type $D (sub $C (struct)))

;; YESTNH: (type $E (sub $C (struct )))
;; NO_TNH: (type $E (sub $D (struct )))
;; YESTNH: (type $E (sub $C (struct)))
;; NO_TNH: (type $E (sub $D (struct)))
(type $E (sub $D (struct)))

;; YESTNH: (type $4 (func (param anyref)))
Expand Down Expand Up @@ -264,21 +264,21 @@
(module
(rec
;; YESTNH: (rec
;; YESTNH-NEXT: (type $A (sub (struct )))
;; YESTNH-NEXT: (type $A (sub (struct)))
;; NO_TNH: (rec
;; NO_TNH-NEXT: (type $A (sub (struct )))
;; NO_TNH-NEXT: (type $A (sub (struct)))
(type $A (sub (struct)))

;; YESTNH: (type $B1 (sub $A (struct )))
;; YESTNH: (type $B1 (sub $A (struct)))

;; YESTNH: (type $2 (func (param anyref)))

;; YESTNH: (type $B (sub $A (struct )))
;; NO_TNH: (type $B1 (sub $A (struct )))
;; YESTNH: (type $B (sub $A (struct)))
;; NO_TNH: (type $B1 (sub $A (struct)))

;; NO_TNH: (type $2 (func (param anyref)))

;; NO_TNH: (type $B (sub $A (struct )))
;; NO_TNH: (type $B (sub $A (struct)))
(type $B (sub $A (struct)))

(type $B1 (sub $A (struct))) ;; this is a new type
Expand Down Expand Up @@ -362,14 +362,14 @@
(module
(rec
;; NO_TNH: (rec
;; NO_TNH-NEXT: (type $A (sub (struct )))
;; NO_TNH-NEXT: (type $A (sub (struct)))
(type $A (sub (struct)))

(type $B (sub $A (struct)))

;; YESTNH: (rec
;; YESTNH-NEXT: (type $B1 (sub (struct )))
;; NO_TNH: (type $B1 (sub $A (struct )))
;; YESTNH-NEXT: (type $B1 (sub (struct)))
;; NO_TNH: (type $B1 (sub $A (struct)))
(type $B1 (sub $A (struct))) ;; this is a new type
)

Expand Down Expand Up @@ -449,15 +449,15 @@
;; A chain, $A :> $B :> $C, where we can optimize $A all the way to $C.
(module
;; NO_TNH: (rec
;; NO_TNH-NEXT: (type $A (sub (struct )))
;; NO_TNH-NEXT: (type $A (sub (struct)))
(type $A (sub (struct)))

;; NO_TNH: (type $B (sub $A (struct )))
;; NO_TNH: (type $B (sub $A (struct)))
(type $B (sub $A (struct)))

;; YESTNH: (rec
;; YESTNH-NEXT: (type $C (sub (struct )))
;; NO_TNH: (type $C (sub $B (struct )))
;; YESTNH-NEXT: (type $C (sub (struct)))
;; NO_TNH: (type $C (sub $B (struct)))
(type $C (sub $B (struct)))

;; YESTNH: (type $1 (func (param anyref)))
Expand Down Expand Up @@ -824,17 +824,17 @@
;; NO_TNH: (rec
;; NO_TNH-NEXT: (type $0 (func (param anyref)))

;; NO_TNH: (type $A (sub (struct )))
;; NO_TNH: (type $A (sub (struct)))
(type $A (sub (struct)))

;; NO_TNH: (type $B (sub $A (struct )))
;; NO_TNH: (type $B (sub $A (struct)))
(type $B (sub $A (struct)))

;; YESTNH: (rec
;; YESTNH-NEXT: (type $0 (func (param anyref)))

;; YESTNH: (type $C1 (sub (struct )))
;; NO_TNH: (type $C1 (sub $B (struct )))
;; YESTNH: (type $C1 (sub (struct)))
;; NO_TNH: (type $C1 (sub $B (struct)))
(type $C1 (sub $B (struct)))

(type $C2 (sub $B (struct)))
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/dae-gc-refine-params.wast
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
;; RUN: wasm-opt %s -all --dae -S -o - | filecheck %s

(module
;; CHECK: (type $"{}" (sub (struct )))
;; CHECK: (type $"{}" (sub (struct)))
(type $"{}" (sub (struct)))

;; CHECK: (type $"{i32}" (sub $"{}" (struct (field i32))))
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/dae-gc-refine-return.wast
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
;; RUN: wasm-opt %s -all --dae -S -o - | filecheck %s

(module
;; CHECK: (type $"{}" (sub (struct )))
;; CHECK: (type $"{}" (sub (struct)))
(type $"{}" (sub (struct)))

;; CHECK: (type $"return_{}" (func (result (ref $"{}"))))
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/dae-gc.wast
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
;; RUN: foreach %s %t wasm-opt -all --dae -S -o - | filecheck %s

(module
;; CHECK: (type $"{}" (struct ))
;; CHECK: (type $"{}" (struct))
(type $"{}" (struct))

;; CHECK: (func $foo (type $0)
Expand Down
4 changes: 2 additions & 2 deletions test/lit/passes/global-refining.wast
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@

;; CHECK: (type $0 (func))

;; CHECK: (type $struct (struct ))
;; CHECK: (type $struct (struct))
;; CLOSD: (type $0 (func))

;; CLOSD: (type $struct (struct ))
;; CLOSD: (type $struct (struct))
(type $struct (struct))
(type $array (array i8))

Expand Down
Loading