File: simple_ref_is_null.wast

package info (click to toggle)
rust-wasmtime 26.0.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 48,492 kB
  • sloc: ansic: 4,003; sh: 561; javascript: 542; cpp: 254; asm: 175; ml: 96; makefile: 55
file content (17 lines) | stat: -rw-r--r-- 598 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(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))