diff options
Diffstat (limited to 'test/spec/ref_is_null.wast')
-rw-r--r-- | test/spec/ref_is_null.wast | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/spec/ref_is_null.wast b/test/spec/ref_is_null.wast new file mode 100644 index 000000000..dbf465149 --- /dev/null +++ b/test/spec/ref_is_null.wast @@ -0,0 +1,15 @@ +(module + (func $f1 (export "nullref") (param $x nullref) (result i32) + (ref.is_null (local.get $x)) + ) + (func $f2 (export "anyref") (param $x anyref) (result i32) + (ref.is_null (local.get $x)) + ) + (func $f3 (export "funcref") (param $x funcref) (result i32) + (ref.is_null (local.get $x)) + ) +) + +(assert_return (invoke "nullref" (ref.null)) (i32.const 1)) +(assert_return (invoke "anyref" (ref.null)) (i32.const 1)) +(assert_return (invoke "funcref" (ref.null)) (i32.const 1)) |