Debian Codegraph @

tests/cli/function-references/table-nonnull.wast

raw
1 ;; RUN: wast --assert default --snapshot tests/snapshots %
2
3 ;; Table initializer
4
5 (module
6 (type $dummy (func))
7 (func $dummy)
8
9 (table $t1 10 funcref)
10 (table $t2 10 funcref (ref.func $dummy))
11 (table $t3 10 (ref $dummy) (ref.func $dummy))
12 (table $t4 10 (ref func) (ref.func $dummy))
13
14 (func (export "get1") (result funcref) (table.get $t1 (i32.const 1)))
15 (func (export "get2") (result funcref) (table.get $t2 (i32.const 4)))
16 (func (export "get3") (result funcref) (table.get $t3 (i32.const 7)))
17 )
18
19 (assert_return (invoke "get1") (ref.null))
20 (assert_return (invoke "get2") (ref.func))
21 (assert_return (invoke "get3") (ref.func))