|
664 | 664 | (module |
665 | 665 | ;; CHECK: (type $none_=>_none (func_subtype func)) |
666 | 666 |
|
| 667 | + ;; CHECK: (type $struct (struct_subtype (field i32) data)) |
| 668 | + |
667 | 669 | ;; CHECK: (type $substruct (struct_subtype (field i32) (field f64) $struct)) |
668 | 670 | (type $substruct (struct_subtype i32 f64 $struct)) |
669 | 671 |
|
670 | | - ;; CHECK: (type $struct (struct_subtype (field i32) data)) |
671 | 672 | (type $struct (struct i32)) |
672 | 673 |
|
673 | 674 | ;; CHECK: (func $create (type $none_=>_none) |
|
834 | 835 | (module |
835 | 836 | ;; CHECK: (type $none_=>_none (func_subtype func)) |
836 | 837 |
|
| 838 | + ;; CHECK: (type $struct (struct_subtype (field i32) data)) |
| 839 | + |
837 | 840 | ;; CHECK: (type $substruct (struct_subtype (field i32) (field f64) $struct)) |
838 | 841 | (type $substruct (struct_subtype i32 f64 $struct)) |
839 | 842 |
|
840 | | - ;; CHECK: (type $struct (struct_subtype (field i32) data)) |
841 | 843 | (type $struct (struct i32)) |
842 | 844 |
|
843 | 845 | ;; CHECK: (func $create (type $none_=>_none) |
|
958 | 960 | ;; Multi-level subtyping, check that we propagate not just to the immediate |
959 | 961 | ;; supertype but all the way as needed. |
960 | 962 | (module |
| 963 | + ;; CHECK: (type $struct1 (struct_subtype (field i32) data)) |
| 964 | + |
| 965 | + ;; CHECK: (type $struct2 (struct_subtype (field i32) (field f64) $struct1)) |
| 966 | + |
961 | 967 | ;; CHECK: (type $struct3 (struct_subtype (field i32) (field f64) (field anyref) $struct2)) |
962 | 968 | (type $struct3 (struct_subtype i32 f64 anyref $struct2)) |
963 | 969 |
|
964 | | - ;; CHECK: (type $none_=>_none (func_subtype func)) |
965 | | - |
966 | | - ;; CHECK: (type $struct2 (struct_subtype (field i32) (field f64) $struct1)) |
967 | 970 | (type $struct2 (struct_subtype i32 f64 $struct1)) |
968 | 971 |
|
969 | | - ;; CHECK: (type $struct1 (struct_subtype (field i32) data)) |
970 | 972 | (type $struct1 (struct i32)) |
971 | 973 |
|
| 974 | + ;; CHECK: (type $none_=>_none (func_subtype func)) |
| 975 | + |
972 | 976 | ;; CHECK: (func $create (type $none_=>_none) |
973 | 977 | ;; CHECK-NEXT: (drop |
974 | 978 | ;; CHECK-NEXT: (struct.new_with_rtt $struct3 |
|
1093 | 1097 | ;; different values in the sub-most type. Create the top and bottom types, but |
1094 | 1098 | ;; not the middle one. |
1095 | 1099 | (module |
| 1100 | + ;; CHECK: (type $struct1 (struct_subtype (field i32) (field i32) data)) |
| 1101 | + |
| 1102 | + ;; CHECK: (type $struct2 (struct_subtype (field i32) (field i32) (field f64) (field f64) $struct1)) |
| 1103 | + |
1096 | 1104 | ;; CHECK: (type $struct3 (struct_subtype (field i32) (field i32) (field f64) (field f64) (field anyref) (field anyref) $struct2)) |
1097 | 1105 | (type $struct3 (struct_subtype i32 i32 f64 f64 anyref anyref $struct2)) |
1098 | 1106 |
|
1099 | | - ;; CHECK: (type $struct1 (struct_subtype (field i32) (field i32) data)) |
1100 | 1107 | (type $struct1 (struct i32 i32)) |
1101 | 1108 |
|
1102 | | - ;; CHECK: (type $struct2 (struct_subtype (field i32) (field i32) (field f64) (field f64) $struct1)) |
1103 | 1109 | (type $struct2 (struct_subtype i32 i32 f64 f64 $struct1)) |
1104 | 1110 |
|
1105 | 1111 | ;; CHECK: (type $anyref_=>_none (func_subtype (param anyref) func)) |
|
1427 | 1433 | ;; As above, but add not just a new of the middle class with a different value |
1428 | 1434 | ;; but also a set. That prevents all optimizations. |
1429 | 1435 | (module |
| 1436 | + ;; CHECK: (type $struct1 (struct_subtype (field (mut i32)) data)) |
| 1437 | + |
1430 | 1438 | ;; CHECK: (type $struct2 (struct_subtype (field (mut i32)) (field f64) $struct1)) |
1431 | 1439 | (type $struct2 (struct_subtype (mut i32) f64 $struct1)) |
1432 | 1440 |
|
1433 | | - ;; CHECK: (type $struct1 (struct_subtype (field (mut i32)) data)) |
1434 | 1441 | (type $struct1 (struct (mut i32))) |
1435 | 1442 |
|
1436 | 1443 | ;; CHECK: (type $struct3 (struct_subtype (field (mut i32)) (field f64) (field anyref) $struct2)) |
|
1657 | 1664 | ;; sets, and the final subtype C has a create and a get. The set to A should |
1658 | 1665 | ;; apply to it, preventing optimization. |
1659 | 1666 | (module |
| 1667 | + ;; CHECK: (type $A (struct_subtype (field (mut i32)) data)) |
| 1668 | + |
| 1669 | + ;; CHECK: (type $B (struct_subtype (field (mut i32)) $A)) |
| 1670 | + |
1660 | 1671 | ;; CHECK: (type $C (struct_subtype (field (mut i32)) $B)) |
1661 | 1672 | (type $C (struct_subtype (mut i32) $B)) |
1662 | 1673 |
|
1663 | | - ;; CHECK: (type $A (struct_subtype (field (mut i32)) data)) |
1664 | 1674 | (type $A (struct (mut i32))) |
1665 | 1675 |
|
| 1676 | + (type $B (struct_subtype (mut i32) $A)) |
| 1677 | + |
1666 | 1678 | ;; CHECK: (type $none_=>_none (func_subtype func)) |
1667 | 1679 |
|
1668 | 1680 | ;; CHECK: (type $ref|$A|_=>_none (func_subtype (param (ref $A)) func)) |
1669 | 1681 |
|
1670 | 1682 | ;; CHECK: (type $ref|$C|_=>_none (func_subtype (param (ref $C)) func)) |
1671 | 1683 |
|
1672 | | - ;; CHECK: (type $B (struct_subtype (field (mut i32)) $A)) |
1673 | | - (type $B (struct_subtype (mut i32) $A)) |
1674 | | - |
1675 | 1684 | ;; CHECK: (func $create (type $none_=>_none) |
1676 | 1685 | ;; CHECK-NEXT: (drop |
1677 | 1686 | ;; CHECK-NEXT: (struct.new_with_rtt $C |
|
0 commit comments