| 1 |
(module |
| 2 |
(type $t0 (;0;) (sub (func (result funcref)))) |
| 3 |
(rec |
| 4 |
(type $t1 (;1;) (sub $t0 (func (result (ref null $t1))))) |
| 5 |
) |
| 6 |
(rec |
| 7 |
(type $t2 (;2;) (sub $t1 (func (result (ref null $t2))))) |
| 8 |
) |
| 9 |
(type (;3;) (func)) |
| 10 |
(table (;0;) 3 3 funcref) |
| 11 |
(export "run" (func 3)) |
| 12 |
(export "fail1" (func 4)) |
| 13 |
(export "fail2" (func 5)) |
| 14 |
(export "fail3" (func 6)) |
| 15 |
(export "fail4" (func 7)) |
| 16 |
(export "fail5" (func 8)) |
| 17 |
(export "fail6" (func 9)) |
| 18 |
(elem (;0;) (table 0) (i32.const 0) func $f0 $f1 $f2) |
| 19 |
(func $f0 (;0;) (type $t0) (result funcref) |
| 20 |
ref.null func |
| 21 |
) |
| 22 |
(func $f1 (;1;) (type $t1) (result (ref null $t1)) |
| 23 |
ref.null $t1 |
| 24 |
) |
| 25 |
(func $f2 (;2;) (type $t2) (result (ref null $t2)) |
| 26 |
ref.null $t2 |
| 27 |
) |
| 28 |
(func (;3;) (type 3) |
| 29 |
block (result funcref) ;; label = @1 |
| 30 |
i32.const 0 |
| 31 |
call_indirect (type $t0) |
| 32 |
end |
| 33 |
block (result funcref) ;; label = @1 |
| 34 |
i32.const 1 |
| 35 |
call_indirect (type $t0) |
| 36 |
end |
| 37 |
block (result funcref) ;; label = @1 |
| 38 |
i32.const 2 |
| 39 |
call_indirect (type $t0) |
| 40 |
end |
| 41 |
block (result (ref null $t1)) ;; label = @1 |
| 42 |
i32.const 1 |
| 43 |
call_indirect (type $t1) |
| 44 |
end |
| 45 |
block (result (ref null $t1)) ;; label = @1 |
| 46 |
i32.const 2 |
| 47 |
call_indirect (type $t1) |
| 48 |
end |
| 49 |
block (result (ref null $t2)) ;; label = @1 |
| 50 |
i32.const 2 |
| 51 |
call_indirect (type $t2) |
| 52 |
end |
| 53 |
block (result (ref null $t0)) ;; label = @1 |
| 54 |
i32.const 0 |
| 55 |
table.get 0 |
| 56 |
ref.cast (ref $t0) |
| 57 |
end |
| 58 |
block (result (ref null $t0)) ;; label = @1 |
| 59 |
i32.const 1 |
| 60 |
table.get 0 |
| 61 |
ref.cast (ref $t0) |
| 62 |
end |
| 63 |
block (result (ref null $t0)) ;; label = @1 |
| 64 |
i32.const 2 |
| 65 |
table.get 0 |
| 66 |
ref.cast (ref $t0) |
| 67 |
end |
| 68 |
block (result (ref null $t1)) ;; label = @1 |
| 69 |
i32.const 1 |
| 70 |
table.get 0 |
| 71 |
ref.cast (ref $t1) |
| 72 |
end |
| 73 |
block (result (ref null $t1)) ;; label = @1 |
| 74 |
i32.const 2 |
| 75 |
table.get 0 |
| 76 |
ref.cast (ref $t1) |
| 77 |
end |
| 78 |
block (result (ref null $t2)) ;; label = @1 |
| 79 |
i32.const 2 |
| 80 |
table.get 0 |
| 81 |
ref.cast (ref $t2) |
| 82 |
end |
| 83 |
br 0 |
| 84 |
) |
| 85 |
(func (;4;) (type 3) |
| 86 |
block (result (ref null $t1)) ;; label = @1 |
| 87 |
i32.const 0 |
| 88 |
call_indirect (type $t1) |
| 89 |
end |
| 90 |
br 0 |
| 91 |
) |
| 92 |
(func (;5;) (type 3) |
| 93 |
block (result (ref null $t1)) ;; label = @1 |
| 94 |
i32.const 0 |
| 95 |
call_indirect (type $t2) |
| 96 |
end |
| 97 |
br 0 |
| 98 |
) |
| 99 |
(func (;6;) (type 3) |
| 100 |
block (result (ref null $t1)) ;; label = @1 |
| 101 |
i32.const 1 |
| 102 |
call_indirect (type $t2) |
| 103 |
end |
| 104 |
br 0 |
| 105 |
) |
| 106 |
(func (;7;) (type 3) |
| 107 |
i32.const 0 |
| 108 |
table.get 0 |
| 109 |
ref.cast (ref $t1) |
| 110 |
br 0 |
| 111 |
) |
| 112 |
(func (;8;) (type 3) |
| 113 |
i32.const 0 |
| 114 |
table.get 0 |
| 115 |
ref.cast (ref $t2) |
| 116 |
br 0 |
| 117 |
) |
| 118 |
(func (;9;) (type 3) |
| 119 |
i32.const 1 |
| 120 |
table.get 0 |
| 121 |
ref.cast (ref $t2) |
| 122 |
br 0 |
| 123 |
) |
| 124 |
) |