Debian Codegraph @

tests/snapshots/testsuite/proposals/wasm-3.0/ref_cast.wast/0.print

raw
1 (module
2 (type $ft (;0;) (func))
3 (type $st (;1;) (struct))
4 (type $at (;2;) (array i8))
5 (type (;3;) (func (param externref)))
6 (type (;4;) (func (param i32)))
7 (table (;0;) 10 anyref)
8 (export "init" (func 1))
9 (export "ref_cast_non_null" (func 2))
10 (export "ref_cast_null" (func 3))
11 (export "ref_cast_i31" (func 4))
12 (export "ref_cast_struct" (func 5))
13 (export "ref_cast_array" (func 6))
14 (elem (;0;) declare func $f)
15 (func $f (;0;) (type $ft))
16 (func (;1;) (type 3) (param $x externref)
17 i32.const 0
18 ref.null any
19 table.set 0
20 i32.const 1
21 i32.const 7
22 ref.i31
23 table.set 0
24 i32.const 2
25 struct.new_default $st
26 table.set 0
27 i32.const 3
28 i32.const 0
29 array.new_default $at
30 table.set 0
31 i32.const 4
32 local.get $x
33 any.convert_extern
34 table.set 0
35 i32.const 5
36 ref.null i31
37 table.set 0
38 i32.const 6
39 ref.null struct
40 table.set 0
41 i32.const 7
42 ref.null none
43 table.set 0
44 )
45 (func (;2;) (type 4) (param $i i32)
46 local.get $i
47 table.get 0
48 ref.as_non_null
49 drop
50 local.get $i
51 table.get 0
52 ref.cast anyref
53 drop
54 )
55 (func (;3;) (type 4) (param $i i32)
56 local.get $i
57 table.get 0
58 ref.cast anyref
59 drop
60 local.get $i
61 table.get 0
62 ref.cast structref
63 drop
64 local.get $i
65 table.get 0
66 ref.cast arrayref
67 drop
68 local.get $i
69 table.get 0
70 ref.cast i31ref
71 drop
72 local.get $i
73 table.get 0
74 ref.cast nullref
75 drop
76 )
77 (func (;4;) (type 4) (param $i i32)
78 local.get $i
79 table.get 0
80 ref.cast (ref i31)
81 drop
82 local.get $i
83 table.get 0
84 ref.cast i31ref
85 drop
86 )
87 (func (;5;) (type 4) (param $i i32)
88 local.get $i
89 table.get 0
90 ref.cast (ref struct)
91 drop
92 local.get $i
93 table.get 0
94 ref.cast structref
95 drop
96 )
97 (func (;6;) (type 4) (param $i i32)
98 local.get $i
99 table.get 0
100 ref.cast (ref array)
101 drop
102 local.get $i
103 table.get 0
104 ref.cast arrayref
105 drop
106 )
107 )