You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
598 B
17 lines
598 B
(module
|
|
(func (export "func_is_null") (param funcref) (result i32)
|
|
(ref.is_null (local.get 0))
|
|
)
|
|
(func (export "func_is_null_with_non_null_funcref") (result i32)
|
|
(call 0 (ref.func 0))
|
|
)
|
|
(func (export "extern_is_null") (param externref) (result i32)
|
|
(ref.is_null (local.get 0))
|
|
)
|
|
)
|
|
|
|
(assert_return (invoke "func_is_null" (ref.null func)) (i32.const 1))
|
|
(assert_return (invoke "func_is_null_with_non_null_funcref") (i32.const 0))
|
|
|
|
(assert_return (invoke "extern_is_null" (ref.null extern)) (i32.const 1))
|
|
(assert_return (invoke "extern_is_null" (ref.extern 1)) (i32.const 0))
|
|
|