|
190 | 190 | (module
|
191 | 191 | (rec
|
192 | 192 | ;; CHECK: (rec
|
193 |
| - ;; CHECK-NEXT: (type $super (sub (descriptor $super.desc (struct)))) |
194 |
| - (type $super (sub (descriptor $super.desc (struct)))) |
195 |
| - ;; CHECK: (type $super.desc (sub (describes $super (struct)))) |
196 |
| - (type $super.desc (sub (describes $super (struct)))) |
197 |
| - |
198 |
| - ;; CHECK: (type $sub (sub $super (descriptor $sub.desc (struct)))) |
199 |
| - (type $sub (sub $super (descriptor $sub.desc (struct)))) |
200 |
| - ;; CHECK: (type $sub.desc (sub $super.desc (describes $sub (struct)))) |
201 |
| - (type $sub.desc (sub $super.desc (describes $sub (struct)))) |
| 193 | + ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct)))) |
| 194 | + (type $A (sub (descriptor $A.desc (struct)))) |
| 195 | + ;; CHECK: (type $A.desc (sub (describes $A (struct)))) |
| 196 | + (type $A.desc (sub (describes $A (struct)))) |
| 197 | + |
| 198 | + ;; CHECK: (type $B (sub $A (descriptor $B.desc (struct)))) |
| 199 | + (type $B (sub $A (descriptor $B.desc (struct)))) |
| 200 | + ;; CHECK: (type $B.desc (sub $A.desc (describes $B (struct)))) |
| 201 | + (type $B.desc (sub $A.desc (describes $B (struct)))) |
202 | 202 | )
|
203 | 203 |
|
204 | 204 | ;; CHECK: (type $4 (func (param anyref)))
|
205 | 205 |
|
206 |
| - ;; CHECK: (global $sub.desc (ref $sub.desc) (struct.new_default $sub.desc)) |
207 |
| - (global $sub.desc (ref $sub.desc) (struct.new $sub.desc)) |
| 206 | + ;; CHECK: (global $B.desc (ref $B.desc) (struct.new_default $B.desc)) |
| 207 | + (global $B.desc (ref $B.desc) (struct.new $B.desc)) |
208 | 208 |
|
209 |
| - ;; CHECK: (global $super.desc (ref $super.desc) (struct.new_default $super.desc)) |
210 |
| - (global $super.desc (ref $super.desc) (struct.new $super.desc)) |
| 209 | + ;; CHECK: (global $A.desc (ref $A.desc) (struct.new_default $A.desc)) |
| 210 | + (global $A.desc (ref $A.desc) (struct.new $A.desc)) |
211 | 211 |
|
212 | 212 | ;; CHECK: (func $test (type $4) (param $any anyref)
|
213 | 213 | ;; CHECK-NEXT: (drop
|
214 |
| - ;; CHECK-NEXT: (ref.cast (ref $super) |
| 214 | + ;; CHECK-NEXT: (ref.cast (ref $A) |
215 | 215 | ;; CHECK-NEXT: (local.get $any)
|
216 | 216 | ;; CHECK-NEXT: )
|
217 | 217 | ;; CHECK-NEXT: )
|
218 | 218 | ;; CHECK-NEXT: (drop
|
219 |
| - ;; CHECK-NEXT: (ref.cast_desc (ref $sub) |
| 219 | + ;; CHECK-NEXT: (ref.cast_desc (ref $B) |
220 | 220 | ;; CHECK-NEXT: (local.get $any)
|
221 |
| - ;; CHECK-NEXT: (global.get $sub.desc) |
| 221 | + ;; CHECK-NEXT: (global.get $B.desc) |
222 | 222 | ;; CHECK-NEXT: )
|
223 | 223 | ;; CHECK-NEXT: )
|
224 | 224 | ;; CHECK-NEXT: )
|
225 | 225 | (func $test (param $any anyref)
|
226 | 226 | ;; The second cast here is optimizable: it can only be to a single type with
|
227 | 227 | ;; no subtypes, so we can use ref.cast_desc.
|
228 | 228 | (drop
|
229 |
| - (ref.cast (ref $super) |
| 229 | + (ref.cast (ref $A) |
230 | 230 | (local.get $any)
|
231 | 231 | )
|
232 | 232 | )
|
233 | 233 | (drop
|
234 |
| - (ref.cast (ref $sub) |
| 234 | + (ref.cast (ref $B) |
235 | 235 | (local.get $any)
|
236 | 236 | )
|
237 | 237 | )
|
|
0 commit comments