blob: ad2d8862fdb443730936ebc31900380067930843 [file] [log] [blame]
(module
(type $none_=>_anyref (func (result anyref)))
(type $sig_anyref (func (param anyref)))
(type $sig_funcref (func (param funcref)))
(type $none_=>_funcref (func (result funcref)))
(type $sig_externref (func (param externref)))
(type $none_=>_none (func))
(type $none_=>_externref (func (result externref)))
(type $i32_=>_none (func (param i32)))
(type $externref_=>_funcref (func (param externref) (result funcref)))
(import "env" "import_global" (global $import_global externref))
(import "env" "import_func" (func $import_func (param externref) (result funcref)))
(global $global_externref (mut externref) (ref.null extern))
(global $global_funcref (mut funcref) (ref.null func))
(global $global_funcref_func (mut funcref) (ref.func $foo))
(global $global_anyref (mut anyref) (ref.null any))
(global $global_anyref2 (mut anyref) (ref.null extern))
(global $global_anyref3 (mut anyref) (ref.null func))
(global $global_anyref4 (mut anyref) (ref.func $foo))
(table $0 3 3 funcref)
(elem (i32.const 0) $take_externref $take_funcref $take_anyref)
(elem declare func $foo $ref-taken-but-not-in-table)
(tag $tag$0 (param i32))
(export "export_func" (func $import_func))
(export "export_global" (global $import_global))
(func $take_externref (param $0 externref)
(nop)
)
(func $take_funcref (param $0 funcref)
(nop)
)
(func $take_anyref (param $0 anyref)
(nop)
)
(func $foo
(nop)
)
(func $test
(local $local_externref externref)
(local $local_funcref funcref)
(local $local_anyref anyref)
(local.set $local_externref
(local.get $local_externref)
)
(local.set $local_externref
(global.get $global_externref)
)
(local.set $local_externref
(ref.null extern)
)
(local.set $local_funcref
(local.get $local_funcref)
)
(local.set $local_funcref
(global.get $global_funcref)
)
(local.set $local_funcref
(ref.null func)
)
(local.set $local_funcref
(ref.func $foo)
)
(local.set $local_anyref
(local.get $local_anyref)
)
(local.set $local_anyref
(global.get $global_anyref)
)
(local.set $local_anyref
(ref.null any)
)
(local.set $local_anyref
(local.get $local_externref)
)
(local.set $local_anyref
(global.get $global_externref)
)
(local.set $local_anyref
(ref.null extern)
)
(local.set $local_anyref
(local.get $local_funcref)
)
(local.set $local_anyref
(global.get $global_funcref)
)
(local.set $local_anyref
(ref.null func)
)
(local.set $local_anyref
(ref.func $foo)
)
(global.set $global_externref
(global.get $global_externref)
)
(global.set $global_externref
(local.get $local_externref)
)
(global.set $global_externref
(ref.null extern)
)
(global.set $global_funcref
(global.get $global_funcref)
)
(global.set $global_funcref
(local.get $local_funcref)
)
(global.set $global_funcref
(ref.null func)
)
(global.set $global_funcref
(ref.func $foo)
)
(global.set $global_anyref
(global.get $global_anyref)
)
(global.set $global_anyref
(local.get $local_anyref)
)
(global.set $global_anyref
(ref.null any)
)
(global.set $global_anyref
(global.get $global_externref)
)
(global.set $global_anyref
(local.get $local_externref)
)
(global.set $global_anyref
(ref.null extern)
)
(global.set $global_anyref
(global.get $global_funcref)
)
(global.set $global_anyref
(local.get $local_funcref)
)
(global.set $global_anyref
(ref.null func)
)
(global.set $global_anyref
(ref.func $foo)
)
(call $take_externref
(local.get $local_externref)
)
(call $take_externref
(global.get $global_externref)
)
(call $take_externref
(ref.null extern)
)
(call $take_funcref
(local.get $local_funcref)
)
(call $take_funcref
(global.get $global_funcref)
)
(call $take_funcref
(ref.null func)
)
(call $take_funcref
(ref.func $foo)
)
(call $take_anyref
(local.get $local_anyref)
)
(call $take_anyref
(global.get $global_anyref)
)
(call $take_anyref
(ref.null any)
)
(call $take_anyref
(local.get $local_externref)
)
(call $take_anyref
(global.get $global_externref)
)
(call $take_anyref
(ref.null extern)
)
(call $take_anyref
(local.get $local_funcref)
)
(call $take_anyref
(global.get $global_funcref)
)
(call $take_anyref
(ref.null func)
)
(call $take_anyref
(ref.func $foo)
)
(call_indirect $0 (type $sig_externref)
(local.get $local_externref)
(i32.const 0)
)
(call_indirect $0 (type $sig_externref)
(global.get $global_externref)
(i32.const 0)
)
(call_indirect $0 (type $sig_externref)
(ref.null extern)
(i32.const 0)
)
(call_indirect $0 (type $sig_funcref)
(local.get $local_funcref)
(i32.const 1)
)
(call_indirect $0 (type $sig_funcref)
(global.get $global_funcref)
(i32.const 1)
)
(call_indirect $0 (type $sig_funcref)
(ref.null func)
(i32.const 1)
)
(call_indirect $0 (type $sig_funcref)
(ref.func $foo)
(i32.const 1)
)
(call_indirect $0 (type $sig_anyref)
(local.get $local_anyref)
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
(global.get $global_anyref)
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
(ref.null any)
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
(local.get $local_externref)
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
(global.get $global_externref)
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
(ref.null extern)
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
(local.get $local_funcref)
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
(global.get $global_funcref)
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
(ref.null func)
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
(ref.func $foo)
(i32.const 3)
)
(drop
(block $label$1 (result externref)
(br_if $label$1
(local.get $local_externref)
(i32.const 1)
)
)
)
(drop
(block $label$2 (result externref)
(br_if $label$2
(global.get $global_externref)
(i32.const 1)
)
)
)
(drop
(block $label$3 (result externref)
(br_if $label$3
(ref.null extern)
(i32.const 1)
)
)
)
(drop
(block $label$4 (result funcref)
(br_if $label$4
(local.get $local_funcref)
(i32.const 1)
)
)
)
(drop
(block $label$5 (result funcref)
(br_if $label$5
(global.get $global_funcref)
(i32.const 1)
)
)
)
(drop
(block $label$6 (result funcref)
(br_if $label$6
(ref.null func)
(i32.const 1)
)
)
)
(drop
(block $label$7 (result funcref)
(br_if $label$7
(ref.func $foo)
(i32.const 1)
)
)
)
(drop
(block $label$8 (result anyref)
(br_if $label$8
(local.get $local_anyref)
(i32.const 1)
)
)
)
(drop
(block $label$9 (result anyref)
(br_if $label$9
(global.get $global_anyref)
(i32.const 1)
)
)
)
(drop
(block $label$10 (result anyref)
(br_if $label$10
(ref.null any)
(i32.const 1)
)
)
)
(drop
(block $label$11 (result anyref)
(br_if $label$11
(local.get $local_externref)
(i32.const 1)
)
)
)
(drop
(block $label$12 (result anyref)
(br_if $label$12
(local.get $local_funcref)
(i32.const 1)
)
)
)
(drop
(block $label$13 (result anyref)
(br_if $label$13
(ref.null extern)
(i32.const 1)
)
)
)
(drop
(block $label$14 (result anyref)
(br_if $label$14
(ref.null func)
(i32.const 1)
)
)
)
(drop
(block $label$15 (result anyref)
(br_if $label$15
(ref.func $foo)
(i32.const 1)
)
)
)
(drop
(loop $label$16 (result externref)
(local.get $local_externref)
)
)
(drop
(loop $label$17 (result externref)
(global.get $global_externref)
)
)
(drop
(loop $label$18 (result externref)
(ref.null extern)
)
)
(drop
(loop $label$19 (result funcref)
(local.get $local_funcref)
)
)
(drop
(loop $label$20 (result funcref)
(global.get $global_funcref)
)
)
(drop
(loop $label$21 (result funcref)
(ref.null func)
)
)
(drop
(loop $label$22 (result funcref)
(ref.func $foo)
)
)
(drop
(loop $label$23 (result anyref)
(local.get $local_anyref)
)
)
(drop
(loop $label$24 (result anyref)
(global.get $global_anyref)
)
)
(drop
(loop $label$25 (result anyref)
(ref.null any)
)
)
(drop
(loop $label$26 (result anyref)
(local.get $local_externref)
)
)
(drop
(loop $label$27 (result anyref)
(global.get $global_externref)
)
)
(drop
(loop $label$28 (result anyref)
(ref.null extern)
)
)
(drop
(loop $label$29 (result anyref)
(local.get $local_funcref)
)
)
(drop
(loop $label$30 (result anyref)
(global.get $global_funcref)
)
)
(drop
(loop $label$31 (result anyref)
(ref.null func)
)
)
(drop
(loop $label$32 (result anyref)
(ref.func $foo)
)
)
(drop
(if (result externref)
(i32.const 1)
(local.get $local_externref)
(ref.null extern)
)
)
(drop
(if (result funcref)
(i32.const 1)
(local.get $local_funcref)
(ref.null func)
)
)
(drop
(if (result anyref)
(i32.const 1)
(local.get $local_anyref)
(ref.null any)
)
)
(drop
(if (result anyref)
(i32.const 1)
(local.get $local_externref)
(local.get $local_funcref)
)
)
(drop
(if (result anyref)
(i32.const 1)
(ref.null extern)
(ref.null func)
)
)
(drop
(if (result anyref)
(i32.const 1)
(ref.func $foo)
(ref.null extern)
)
)
(drop
(try $label$47 (result externref)
(do
(local.get $local_externref)
)
(catch $tag$0
(drop
(pop i32)
)
(ref.null extern)
)
)
)
(drop
(try $label$50 (result funcref)
(do
(ref.func $foo)
)
(catch $tag$0
(drop
(pop i32)
)
(ref.null func)
)
)
)
(drop
(try $label$53 (result anyref)
(do
(local.get $local_externref)
)
(catch $tag$0
(drop
(pop i32)
)
(ref.func $foo)
)
)
)
(drop
(try $label$56 (result anyref)
(do
(ref.func $foo)
)
(catch $tag$0
(drop
(pop i32)
)
(local.get $local_externref)
)
)
)
(drop
(select (result externref)
(local.get $local_externref)
(ref.null extern)
(i32.const 1)
)
)
(drop
(select (result funcref)
(local.get $local_funcref)
(ref.null func)
(i32.const 1)
)
)
(drop
(select
(i32.const 0)
(i32.const 2)
(i32.const 1)
)
)
(drop
(select (result anyref)
(local.get $local_externref)
(local.get $local_funcref)
(i32.const 1)
)
)
(drop
(select (result anyref)
(local.get $local_funcref)
(local.get $local_externref)
(i32.const 1)
)
)
(drop
(ref.is_null
(local.get $local_externref)
)
)
(drop
(ref.is_null
(global.get $global_externref)
)
)
(drop
(ref.is_null
(ref.null extern)
)
)
(drop
(ref.is_null
(local.get $local_funcref)
)
)
(drop
(ref.is_null
(global.get $global_funcref)
)
)
(drop
(ref.is_null
(ref.null func)
)
)
(drop
(ref.is_null
(ref.func $foo)
)
)
(drop
(ref.is_null
(local.get $local_anyref)
)
)
(drop
(ref.is_null
(global.get $global_anyref)
)
)
(drop
(ref.is_null
(ref.null any)
)
)
)
(func $return_externref_local (result externref)
(local $local_externref externref)
(local.get $local_externref)
)
(func $return_externref_global (result externref)
(global.get $global_externref)
)
(func $return_externref_null (result externref)
(ref.null extern)
)
(func $return_funcref_local (result funcref)
(local $local_funcref funcref)
(local.get $local_funcref)
)
(func $return_funcref_global (result funcref)
(global.get $global_funcref)
)
(func $return_funcref_null (result funcref)
(ref.null func)
)
(func $return_funcref_func (result funcref)
(ref.func $foo)
)
(func $return_anyref_local (result anyref)
(local $local_anyref anyref)
(local.get $local_anyref)
)
(func $return_anyref_global (result anyref)
(global.get $global_anyref)
)
(func $return_anyref_null (result anyref)
(ref.null any)
)
(func $return_anyref2 (result anyref)
(local $local_externref externref)
(local.get $local_externref)
)
(func $return_anyref3 (result anyref)
(global.get $global_externref)
)
(func $return_anyref4 (result anyref)
(ref.null extern)
)
(func $return_anyref5 (result anyref)
(local $local_funcref funcref)
(local.get $local_funcref)
)
(func $return_anyref6 (result anyref)
(global.get $global_funcref)
)
(func $return_anyref7 (result anyref)
(ref.null func)
)
(func $return_anyref8 (result anyref)
(ref.func $foo)
)
(func $returns_externref (result externref)
(local $local_externref externref)
(return
(local.get $local_externref)
)
)
(func $returns_funcref (result funcref)
(local $local_funcref funcref)
(return
(local.get $local_funcref)
)
)
(func $returns_anyref (result anyref)
(local $local_anyref anyref)
(return
(local.get $local_anyref)
)
)
(func $returns_anyref2 (result anyref)
(local $local_externref externref)
(local $local_funcref funcref)
(return
(local.get $local_externref)
)
)
(func $ref-user
(drop
(ref.func $ref-taken-but-not-in-table)
)
)
(func $ref-taken-but-not-in-table
(nop)
)
)