|
13 | 13 | ;; actually refer to a subtype of them (that has a struct.new). As a result, in
|
14 | 14 | ;; TNH mode $A and $D will also not be emitted in the output anymore.
|
15 | 15 | (module
|
| 16 | + ;; YESTNH: (rec |
| 17 | + ;; YESTNH-NEXT: (type $A (sub (struct))) |
16 | 18 | ;; NO_TNH: (rec
|
17 | 19 | ;; NO_TNH-NEXT: (type $A (sub (struct)))
|
18 | 20 | (type $A (sub (struct)))
|
19 | 21 |
|
20 |
| - ;; YESTNH: (rec |
21 |
| - ;; YESTNH-NEXT: (type $B (sub (struct))) |
| 22 | + ;; YESTNH: (type $B (sub $A (struct))) |
22 | 23 | ;; NO_TNH: (type $B (sub $A (struct)))
|
23 | 24 | (type $B (sub $A (struct)))
|
24 | 25 |
|
25 | 26 | ;; YESTNH: (type $C (sub $B (struct)))
|
26 | 27 | ;; NO_TNH: (type $C (sub $B (struct)))
|
27 | 28 | (type $C (sub $B (struct)))
|
28 | 29 |
|
| 30 | + ;; YESTNH: (type $D (sub $C (struct))) |
29 | 31 | ;; NO_TNH: (type $D (sub $C (struct)))
|
30 | 32 | (type $D (sub $C (struct)))
|
31 | 33 |
|
32 |
| - ;; YESTNH: (type $E (sub $C (struct))) |
| 34 | + ;; YESTNH: (type $E (sub $D (struct))) |
33 | 35 | ;; NO_TNH: (type $E (sub $D (struct)))
|
34 | 36 | (type $E (sub $D (struct)))
|
35 | 37 |
|
36 |
| - ;; YESTNH: (type $3 (func (param anyref))) |
| 38 | + ;; YESTNH: (type $5 (func (param anyref))) |
37 | 39 |
|
38 |
| - ;; YESTNH: (type $4 (func)) |
| 40 | + ;; YESTNH: (type $6 (func)) |
39 | 41 |
|
40 | 42 | ;; YESTNH: (global $global anyref (struct.new_default $B))
|
41 | 43 | ;; NO_TNH: (type $5 (func (param anyref)))
|
|
45 | 47 | ;; NO_TNH: (global $global anyref (struct.new_default $B))
|
46 | 48 | (global $global anyref (struct.new $B))
|
47 | 49 |
|
48 |
| - ;; YESTNH: (func $new (type $3) (param $x anyref) |
| 50 | + ;; YESTNH: (func $new (type $5) (param $x anyref) |
49 | 51 | ;; YESTNH-NEXT: (drop
|
50 | 52 | ;; YESTNH-NEXT: (struct.new_default $C)
|
51 | 53 | ;; YESTNH-NEXT: )
|
|
70 | 72 | )
|
71 | 73 | )
|
72 | 74 |
|
73 |
| - ;; YESTNH: (func $ref.cast (type $3) (param $x anyref) |
| 75 | + ;; YESTNH: (func $ref.cast (type $5) (param $x anyref) |
74 | 76 | ;; YESTNH-NEXT: (drop
|
75 | 77 | ;; YESTNH-NEXT: (ref.cast (ref $B)
|
76 | 78 | ;; YESTNH-NEXT: (local.get $x)
|
|
154 | 156 | )
|
155 | 157 | )
|
156 | 158 |
|
157 |
| - ;; YESTNH: (func $ref.test (type $3) (param $x anyref) |
| 159 | + ;; YESTNH: (func $ref.test (type $5) (param $x anyref) |
158 | 160 | ;; YESTNH-NEXT: (drop
|
159 | 161 | ;; YESTNH-NEXT: (ref.test (ref $B)
|
160 | 162 | ;; YESTNH-NEXT: (local.get $x)
|
|
176 | 178 | )
|
177 | 179 | )
|
178 | 180 |
|
179 |
| - ;; YESTNH: (func $br_on (type $3) (param $x anyref) |
| 181 | + ;; YESTNH: (func $br_on (type $5) (param $x anyref) |
180 | 182 | ;; YESTNH-NEXT: (drop
|
181 | 183 | ;; YESTNH-NEXT: (block $block (result (ref $B))
|
182 | 184 | ;; YESTNH-NEXT: (drop
|
|
213 | 215 | )
|
214 | 216 | )
|
215 | 217 |
|
216 |
| - ;; YESTNH: (func $basic (type $3) (param $x anyref) |
| 218 | + ;; YESTNH: (func $basic (type $5) (param $x anyref) |
217 | 219 | ;; YESTNH-NEXT: (drop
|
218 | 220 | ;; YESTNH-NEXT: (ref.cast (ref struct)
|
219 | 221 | ;; YESTNH-NEXT: (local.get $x)
|
|
236 | 238 | )
|
237 | 239 | )
|
238 | 240 |
|
239 |
| - ;; YESTNH: (func $locals (type $4) |
| 241 | + ;; YESTNH: (func $locals (type $6) |
240 | 242 | ;; YESTNH-NEXT: (local $A (ref $B))
|
241 | 243 | ;; YESTNH-NEXT: (local $B (ref $B))
|
242 | 244 | ;; YESTNH-NEXT: (local $C (ref $C))
|
|
359 | 361 | ;; $B1.
|
360 | 362 | (module
|
361 | 363 | (rec
|
| 364 | + ;; YESTNH: (rec |
| 365 | + ;; YESTNH-NEXT: (type $A (sub (struct))) |
362 | 366 | ;; NO_TNH: (rec
|
363 | 367 | ;; NO_TNH-NEXT: (type $A (sub (struct)))
|
364 | 368 | (type $A (sub (struct)))
|
365 | 369 |
|
366 | 370 | (type $B (sub $A (struct)))
|
367 | 371 |
|
368 |
| - ;; YESTNH: (rec |
369 |
| - ;; YESTNH-NEXT: (type $B1 (sub (struct))) |
| 372 | + ;; YESTNH: (type $B1 (sub $A (struct))) |
370 | 373 | ;; NO_TNH: (type $B1 (sub $A (struct)))
|
371 | 374 | (type $B1 (sub $A (struct))) ;; this is a new type
|
372 | 375 | )
|
373 | 376 |
|
374 |
| - ;; YESTNH: (type $1 (func (param anyref))) |
| 377 | + ;; YESTNH: (type $2 (func (param anyref))) |
375 | 378 |
|
376 |
| - ;; YESTNH: (func $new (type $1) (param $x anyref) |
| 379 | + ;; YESTNH: (func $new (type $2) (param $x anyref) |
377 | 380 | ;; YESTNH-NEXT: (drop
|
378 | 381 | ;; YESTNH-NEXT: (struct.new_default $B1)
|
379 | 382 | ;; YESTNH-NEXT: )
|
|
391 | 394 | )
|
392 | 395 | )
|
393 | 396 |
|
394 |
| - ;; YESTNH: (func $ref.cast (type $1) (param $x anyref) |
| 397 | + ;; YESTNH: (func $ref.cast (type $2) (param $x anyref) |
395 | 398 | ;; YESTNH-NEXT: (drop
|
396 | 399 | ;; YESTNH-NEXT: (ref.cast (ref $B1)
|
397 | 400 | ;; YESTNH-NEXT: (local.get $x)
|
|
446 | 449 |
|
447 | 450 | ;; A chain, $A :> $B :> $C, where we can optimize $A all the way to $C.
|
448 | 451 | (module
|
| 452 | + ;; YESTNH: (rec |
| 453 | + ;; YESTNH-NEXT: (type $A (sub (struct))) |
449 | 454 | ;; NO_TNH: (rec
|
450 | 455 | ;; NO_TNH-NEXT: (type $A (sub (struct)))
|
451 | 456 | (type $A (sub (struct)))
|
452 | 457 |
|
| 458 | + ;; YESTNH: (type $B (sub $A (struct))) |
453 | 459 | ;; NO_TNH: (type $B (sub $A (struct)))
|
454 | 460 | (type $B (sub $A (struct)))
|
455 | 461 |
|
456 |
| - ;; YESTNH: (rec |
457 |
| - ;; YESTNH-NEXT: (type $C (sub (struct))) |
| 462 | + ;; YESTNH: (type $C (sub $B (struct))) |
458 | 463 | ;; NO_TNH: (type $C (sub $B (struct)))
|
459 | 464 | (type $C (sub $B (struct)))
|
460 | 465 |
|
461 |
| - ;; YESTNH: (type $1 (func (param anyref))) |
| 466 | + ;; YESTNH: (type $3 (func (param anyref))) |
462 | 467 |
|
463 |
| - ;; YESTNH: (func $new (type $1) (param $x anyref) |
| 468 | + ;; YESTNH: (func $new (type $3) (param $x anyref) |
464 | 469 | ;; YESTNH-NEXT: (drop
|
465 | 470 | ;; YESTNH-NEXT: (struct.new_default $C)
|
466 | 471 | ;; YESTNH-NEXT: )
|
|
478 | 483 | )
|
479 | 484 | )
|
480 | 485 |
|
481 |
| - ;; YESTNH: (func $ref.cast (type $1) (param $x anyref) |
| 486 | + ;; YESTNH: (func $ref.cast (type $3) (param $x anyref) |
482 | 487 | ;; YESTNH-NEXT: (drop
|
483 | 488 | ;; YESTNH-NEXT: (ref.cast (ref $C)
|
484 | 489 | ;; YESTNH-NEXT: (local.get $x)
|
|
817 | 822 | ;; As above, but now $C1 is created.
|
818 | 823 | (module
|
819 | 824 | (rec
|
| 825 | + ;; YESTNH: (rec |
| 826 | + ;; YESTNH-NEXT: (type $A (sub (struct))) |
820 | 827 | ;; NO_TNH: (rec
|
821 | 828 | ;; NO_TNH-NEXT: (type $A (sub (struct)))
|
822 | 829 | (type $A (sub (struct)))
|
823 | 830 |
|
| 831 | + ;; YESTNH: (type $B (sub $A (struct))) |
824 | 832 | ;; NO_TNH: (type $B (sub $A (struct)))
|
825 | 833 | (type $B (sub $A (struct)))
|
826 | 834 |
|
827 |
| - ;; YESTNH: (rec |
828 |
| - ;; YESTNH-NEXT: (type $C1 (sub (struct))) |
| 835 | + ;; YESTNH: (type $C1 (sub $B (struct))) |
829 | 836 | ;; NO_TNH: (type $C1 (sub $B (struct)))
|
830 | 837 | (type $C1 (sub $B (struct)))
|
831 | 838 |
|
832 | 839 | (type $C2 (sub $B (struct)))
|
833 | 840 | )
|
834 | 841 |
|
835 |
| - ;; YESTNH: (type $1 (func (param anyref))) |
| 842 | + ;; YESTNH: (type $3 (func (param anyref))) |
836 | 843 |
|
837 | 844 | ;; YESTNH: (global $global anyref (struct.new_default $C1))
|
838 | 845 | ;; NO_TNH: (type $3 (func (param anyref)))
|
839 | 846 |
|
840 | 847 | ;; NO_TNH: (global $global anyref (struct.new_default $C1))
|
841 | 848 | (global $global anyref (struct.new $C1))
|
842 | 849 |
|
843 |
| - ;; YESTNH: (func $ref.cast (type $1) (param $x anyref) |
| 850 | + ;; YESTNH: (func $ref.cast (type $3) (param $x anyref) |
844 | 851 | ;; YESTNH-NEXT: (drop
|
845 | 852 | ;; YESTNH-NEXT: (ref.cast (ref $C1)
|
846 | 853 | ;; YESTNH-NEXT: (local.get $x)
|
|
909 | 916 | )
|
910 | 917 | )
|
911 | 918 |
|
912 |
| - ;; YESTNH: (func $ref.cast.null (type $1) (param $x anyref) |
| 919 | + ;; YESTNH: (func $ref.cast.null (type $3) (param $x anyref) |
913 | 920 | ;; YESTNH-NEXT: (drop
|
914 | 921 | ;; YESTNH-NEXT: (ref.cast (ref null $C1)
|
915 | 922 | ;; YESTNH-NEXT: (local.get $x)
|
|
0 commit comments