|
383 | 383 | ;; GUFA: (global $C (ref $struct) (struct.new_default $struct))
|
384 | 384 | (global $C (ref $struct) (struct.new_default $struct))
|
385 | 385 | )
|
| 386 | + |
| 387 | +;; As above, but $struct has a supertype. We must propagate restrictions on it |
| 388 | +;; to its supertype. After doing so, we can refine the field to (ref func) in |
| 389 | +;; both, but no further, because of the restriction of global.get $A, which has |
| 390 | +;; that type. |
| 391 | +(module |
| 392 | + (rec |
| 393 | + ;; NRML: (rec |
| 394 | + ;; NRML-NEXT: (type $super (sub (struct (field (ref func))))) |
| 395 | + ;; GUFA: (rec |
| 396 | + ;; GUFA-NEXT: (type $super (sub (struct (field (ref func))))) |
| 397 | + (type $super (sub (struct (field funcref)))) |
| 398 | + ;; NRML: (type $struct (sub $super (struct (field (ref func))))) |
| 399 | + ;; GUFA: (type $struct (sub $super (struct (field (ref func))))) |
| 400 | + (type $struct (sub $super (struct (field funcref)))) |
| 401 | + ) |
| 402 | + |
| 403 | + ;; NRML: (type $func (func)) |
| 404 | + ;; GUFA: (type $func (func)) |
| 405 | + (type $func (func)) |
| 406 | + |
| 407 | + ;; NRML: (global $A (ref func) (ref.func $func)) |
| 408 | + ;; GUFA: (global $A (ref func) (ref.func $func)) |
| 409 | + (global $A (ref func) (ref.func $func)) |
| 410 | + |
| 411 | + ;; NRML: (global $B (ref $struct) (struct.new $struct |
| 412 | + ;; NRML-NEXT: (global.get $A) |
| 413 | + ;; NRML-NEXT: )) |
| 414 | + ;; GUFA: (global $B (ref $struct) (struct.new $struct |
| 415 | + ;; GUFA-NEXT: (global.get $A) |
| 416 | + ;; GUFA-NEXT: )) |
| 417 | + (global $B (ref $struct) (struct.new $struct |
| 418 | + (global.get $A) |
| 419 | + )) |
| 420 | + |
| 421 | + ;; NRML: (func $func (type $func) |
| 422 | + ;; NRML-NEXT: ) |
| 423 | + ;; GUFA: (func $func (type $func) |
| 424 | + ;; GUFA-NEXT: ) |
| 425 | + (func $func (type $func) |
| 426 | + ) |
| 427 | +) |
0 commit comments