Debian Codegraph @

tests/cli/function-references/bad-call-ref-ty.wast

raw
1 ;; RUN: wast --assert default --snapshot tests/snapshots %
2
3 (assert_invalid
4 (module
5 (type $t (func (param i32)))
6 (func (param $f funcref)
7 (call_ref $t (local.get $f))
8 )
9 )
10 "expected (ref null $type), found funcref")
11
12 (assert_invalid
13 (module
14 (type $t (func (param i32)))
15 (func (param $f (ref $t))
16 (call_ref $t (local.get $f))
17 )
18 )
19 "expected i32 but nothing on stack")
20
21 (assert_invalid
22 (module
23 (type $t (func ))
24 (func (param $f (ref $t))
25 (call_ref 5 (local.get $f))
26 )
27 )
28 "type index out of bounds")
29
30 (assert_invalid
31 (module
32 (type $t (func ))
33 (func (param $f (ref $t))
34 (call_ref 100 (local.get $f))
35 )
36 )
37 "type index out of bounds")