| 1 |
(module |
| 2 |
(type (;0;) (func (param funcref) (result i32))) |
| 3 |
(type (;1;) (func (param externref) (result i32))) |
| 4 |
(type (;2;) (func)) |
| 5 |
(type (;3;) (func (param externref))) |
| 6 |
(type (;4;) (func (param i32) (result i32))) |
| 7 |
(table $t1 (;0;) 2 funcref) |
| 8 |
(table $t2 (;1;) 2 externref) |
| 9 |
(export "funcref" (func $f1)) |
| 10 |
(export "externref" (func $f2)) |
| 11 |
(export "init" (func 3)) |
| 12 |
(export "deinit" (func 4)) |
| 13 |
(export "funcref-elem" (func 5)) |
| 14 |
(export "externref-elem" (func 6)) |
| 15 |
(elem (;0;) (table $t1) (i32.const 1) func $dummy) |
| 16 |
(func $f1 (;0;) (type 0) (param $x funcref) (result i32) |
| 17 |
local.get $x |
| 18 |
ref.is_null |
| 19 |
) |
| 20 |
(func $f2 (;1;) (type 1) (param $x externref) (result i32) |
| 21 |
local.get $x |
| 22 |
ref.is_null |
| 23 |
) |
| 24 |
(func $dummy (;2;) (type 2)) |
| 25 |
(func (;3;) (type 3) (param $r externref) |
| 26 |
i32.const 1 |
| 27 |
local.get $r |
| 28 |
table.set $t2 |
| 29 |
) |
| 30 |
(func (;4;) (type 2) |
| 31 |
i32.const 1 |
| 32 |
ref.null func |
| 33 |
table.set $t1 |
| 34 |
i32.const 1 |
| 35 |
ref.null extern |
| 36 |
table.set $t2 |
| 37 |
) |
| 38 |
(func (;5;) (type 4) (param $x i32) (result i32) |
| 39 |
local.get $x |
| 40 |
table.get $t1 |
| 41 |
call $f1 |
| 42 |
) |
| 43 |
(func (;6;) (type 4) (param $x i32) (result i32) |
| 44 |
local.get $x |
| 45 |
table.get $t2 |
| 46 |
call $f2 |
| 47 |
) |
| 48 |
) |