| 1 |
(module |
| 2 |
(type $ft (;0;) (func (result i32))) |
| 3 |
(type $st (;1;) (struct (field i16))) |
| 4 |
(type $at (;2;) (array i8)) |
| 5 |
(type (;3;) (func (param externref))) |
| 6 |
(type (;4;) (func (param i32) (result i32))) |
| 7 |
(type (;5;) (func (param structref) (result (ref $st)))) |
| 8 |
(type (;6;) (func (param structref) (result (ref $at)))) |
| 9 |
(table (;0;) 10 anyref) |
| 10 |
(export "init" (func 1)) |
| 11 |
(export "br_on_null" (func 2)) |
| 12 |
(export "br_on_i31" (func 3)) |
| 13 |
(export "br_on_struct" (func 4)) |
| 14 |
(export "br_on_array" (func 5)) |
| 15 |
(export "null-diff" (func 6)) |
| 16 |
(elem (;0;) declare func $f) |
| 17 |
(func $f (;0;) (type $ft) (result i32) |
| 18 |
i32.const 9 |
| 19 |
) |
| 20 |
(func (;1;) (type 3) (param $x externref) |
| 21 |
i32.const 0 |
| 22 |
ref.null any |
| 23 |
table.set 0 |
| 24 |
i32.const 1 |
| 25 |
i32.const 7 |
| 26 |
ref.i31 |
| 27 |
table.set 0 |
| 28 |
i32.const 2 |
| 29 |
i32.const 6 |
| 30 |
struct.new $st |
| 31 |
table.set 0 |
| 32 |
i32.const 3 |
| 33 |
i32.const 5 |
| 34 |
i32.const 3 |
| 35 |
array.new $at |
| 36 |
table.set 0 |
| 37 |
i32.const 4 |
| 38 |
local.get $x |
| 39 |
any.convert_extern |
| 40 |
table.set 0 |
| 41 |
) |
| 42 |
(func (;2;) (type 4) (param $i i32) (result i32) |
| 43 |
block $l |
| 44 |
local.get $i |
| 45 |
table.get 0 |
| 46 |
br_on_null $l |
| 47 |
i32.const -1 |
| 48 |
return |
| 49 |
end |
| 50 |
i32.const 0 |
| 51 |
) |
| 52 |
(func (;3;) (type 4) (param $i i32) (result i32) |
| 53 |
block $l (result (ref i31)) |
| 54 |
local.get $i |
| 55 |
table.get 0 |
| 56 |
br_on_cast $l anyref (ref i31) |
| 57 |
i32.const -1 |
| 58 |
return |
| 59 |
end |
| 60 |
i31.get_u |
| 61 |
) |
| 62 |
(func (;4;) (type 4) (param $i i32) (result i32) |
| 63 |
block $l (result (ref struct)) |
| 64 |
local.get $i |
| 65 |
table.get 0 |
| 66 |
br_on_cast $l anyref (ref struct) |
| 67 |
i32.const -1 |
| 68 |
return |
| 69 |
end |
| 70 |
block $l2 (type 5) (param structref) (result (ref $st)) |
| 71 |
block $l3 (type 6) (param structref) (result (ref $at)) |
| 72 |
br_on_cast $l2 structref (ref $st) |
| 73 |
br_on_cast $l3 anyref (ref $at) |
| 74 |
i32.const -2 |
| 75 |
return |
| 76 |
end |
| 77 |
i32.const 0 |
| 78 |
array.get_u $at |
| 79 |
return |
| 80 |
end |
| 81 |
struct.get_s $st 0 |
| 82 |
) |
| 83 |
(func (;5;) (type 4) (param $i i32) (result i32) |
| 84 |
block $l (result (ref array)) |
| 85 |
local.get $i |
| 86 |
table.get 0 |
| 87 |
br_on_cast $l anyref (ref array) |
| 88 |
i32.const -1 |
| 89 |
return |
| 90 |
end |
| 91 |
array.len |
| 92 |
) |
| 93 |
(func (;6;) (type 4) (param $i i32) (result i32) |
| 94 |
block $l (result structref) |
| 95 |
block (result (ref any)) ;; label = @2 |
| 96 |
local.get $i |
| 97 |
table.get 0 |
| 98 |
br_on_cast $l anyref structref |
| 99 |
end |
| 100 |
i32.const 0 |
| 101 |
return |
| 102 |
end |
| 103 |
i32.const 1 |
| 104 |
return |
| 105 |
) |
| 106 |
) |