|
| 1 | +;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. |
| 2 | + |
| 3 | +;; RUN: foreach %s %t wasm-opt --abstract-type-refining --remove-unused-types --traps-never-happen \ |
| 4 | +;; RUN: -all --closed-world --preserve-type-order -S -o - | filecheck %s --check-prefix=YESTNH |
| 5 | +;; RUN: foreach %s %t wasm-opt --abstract-type-refining --remove-unused-types \ |
| 6 | +;; RUN: -all --closed-world --preserve-type-order -S -o - | filecheck %s --check-prefix=NO_TNH |
| 7 | + |
| 8 | +;; Run in both TNH and non-TNH mode. |
| 9 | + |
| 10 | +(module |
| 11 | + ;; We should not try to generate invalid types by removing the subtype |
| 12 | + ;; relation between $B.desc and $A.desc. |
| 13 | + (rec |
| 14 | + ;; YESTNH: (rec |
| 15 | + ;; YESTNH-NEXT: (type $A (sub (descriptor $A.desc (struct)))) |
| 16 | + ;; NO_TNH: (rec |
| 17 | + ;; NO_TNH-NEXT: (type $A (sub (descriptor $A.desc (struct)))) |
| 18 | + (type $A (sub (descriptor $A.desc (struct)))) |
| 19 | + ;; YESTNH: (type $A.desc (sub (describes $A (struct)))) |
| 20 | + ;; NO_TNH: (type $A.desc (sub (describes $A (struct)))) |
| 21 | + (type $A.desc (sub (describes $A (struct)))) |
| 22 | + ;; YESTNH: (type $B (sub $A (descriptor $B.desc (struct)))) |
| 23 | + ;; NO_TNH: (type $B (sub $A (descriptor $B.desc (struct)))) |
| 24 | + (type $B (sub $A (descriptor $B.desc (struct)))) |
| 25 | + ;; YESTNH: (type $B.desc (sub $A.desc (describes $B (struct)))) |
| 26 | + ;; NO_TNH: (type $B.desc (sub $A.desc (describes $B (struct)))) |
| 27 | + (type $B.desc (sub $A.desc (describes $B (struct)))) |
| 28 | + ) |
| 29 | + ;; YESTNH: (global $g (ref (exact $B)) (struct.new_default $B |
| 30 | + ;; YESTNH-NEXT: (ref.null none) |
| 31 | + ;; YESTNH-NEXT: )) |
| 32 | + ;; NO_TNH: (global $g (ref (exact $B)) (struct.new_default $B |
| 33 | + ;; NO_TNH-NEXT: (ref.null none) |
| 34 | + ;; NO_TNH-NEXT: )) |
| 35 | + (global $g (ref (exact $B)) |
| 36 | + (struct.new_default $B |
| 37 | + (ref.null none) |
| 38 | + ) |
| 39 | + ) |
| 40 | +) |
0 commit comments