(module
 (type $0 (func (result i32)))
 (type $1 (func (result funcref)))
 (elem declare func $0)
 (func $0 (type $0) (result i32)
  (i32.const 0)
 )
 (func $test (type $1) (result funcref)
  (ref.func $0)
 )
)
(module
 (type $0 (func))
 (global $bar i32 (i32.const 0))
 (memory $foo 16 16)
 (export "memory" (memory $foo))
 (export "global" (global $bar))
 (func $bar (type $0)
 )
)
(module
 (type $func (func (result i32)))
 (global $global$0 (ref $func) (ref.func $foo))
 (export "export" (func $export))
 (func $foo (type $func) (result i32)
  (unreachable)
 )
 (func $export (type $func) (result i32)
  (call_ref $func
   (global.get $global$0)
  )
 )
)
