Debian Codegraph @

tests/cli/dump-llvm-object.wat

raw
1 ;; RUN: dump %
2
3 ;; This test case was generated with this Rust source file:
4 ;;
5 ;; fn main() {}
6 ;;
7 ;; compiled with Rust 1.78.0 with:
8 ;;
9 ;; rustc foo.rs --emit obj --target wasm32-wasip1
10 ;;
11 ;; and then the output of `wasm-tools print` at the time over `foo.o` was
12 ;; pasted below. This works around how the linking and reloc custom sections do
13 ;; not have a text format at this time.
14
15 (module
16 (type (;0;) (func (param i32)))
17 (type (;1;) (func (param i32 i32 i32 i32) (result i32)))
18 (type (;2;) (func (param i32 i32 i32 i32 i32) (result i32)))
19 (type (;3;) (func (param i32) (result i32)))
20 (type (;4;) (func (result i32)))
21 (type (;5;) (func))
22 (import "env" "__linear_memory" (memory (;0;) 1))
23 (import "env" "__stack_pointer" (global (;0;) (mut i32)))
24 (import "env" "_ZN3std2rt19lang_start_internal17h8f61396649e22e0eE" (func (;0;) (type 2)))
25 (import "env" "__indirect_function_table" (table (;0;) 4 funcref))
26 (func (;1;) (type 0) (param i32)
27 local.get 0
28 call 2
29 return
30 )
31 (func (;2;) (type 0) (param i32)
32 (local i32 i32 i32 i32 i32)
33 global.get 0
34 local.set 1
35 i32.const 16
36 local.set 2
37 local.get 1
38 local.get 2
39 i32.sub
40 local.set 3
41 local.get 3
42 global.set 0
43 local.get 0
44 call_indirect (type 5)
45 i32.const 16
46 local.set 4
47 local.get 3
48 local.get 4
49 i32.add
50 local.set 5
51 local.get 5
52 global.set 0
53 return
54 )
55 (func (;3;) (type 1) (param i32 i32 i32 i32) (result i32)
56 (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
57 global.get 0
58 local.set 4
59 i32.const 16
60 local.set 5
61 local.get 4
62 local.get 5
63 i32.sub
64 local.set 6
65 local.get 6
66 global.set 0
67 local.get 6
68 local.get 0
69 i32.store offset=12
70 i32.const 12
71 local.set 7
72 local.get 6
73 local.get 7
74 i32.add
75 local.set 8
76 local.get 8
77 local.set 9
78 i32.const 0
79 local.set 10
80 local.get 9
81 local.get 10
82 local.get 1
83 local.get 2
84 local.get 3
85 call 0
86 local.set 11
87 local.get 6
88 local.get 11
89 i32.store offset=8
90 local.get 6
91 i32.load offset=8
92 local.set 12
93 i32.const 16
94 local.set 13
95 local.get 6
96 local.get 13
97 i32.add
98 local.set 14
99 local.get 14
100 global.set 0
101 local.get 12
102 return
103 )
104 (func (;4;) (type 3) (param i32) (result i32)
105 (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
106 global.get 0
107 local.set 1
108 i32.const 16
109 local.set 2
110 local.get 1
111 local.get 2
112 i32.sub
113 local.set 3
114 local.get 3
115 global.set 0
116 local.get 0
117 i32.load
118 local.set 4
119 local.get 4
120 call 1
121 call 5
122 local.set 5
123 i32.const 1
124 local.set 6
125 local.get 5
126 local.get 6
127 i32.and
128 local.set 7
129 local.get 3
130 local.get 7
131 i32.store8 offset=15
132 local.get 3
133 i32.load8_u offset=15
134 local.set 8
135 i32.const 1
136 local.set 9
137 local.get 8
138 local.get 9
139 i32.and
140 local.set 10
141 i32.const 16
142 local.set 11
143 local.get 3
144 local.get 11
145 i32.add
146 local.set 12
147 local.get 12
148 global.set 0
149 local.get 10
150 return
151 )
152 (func (;5;) (type 4) (result i32)
153 (local i32 i32 i32)
154 i32.const 0
155 local.set 0
156 i32.const 1
157 local.set 1
158 local.get 0
159 local.get 1
160 i32.and
161 local.set 2
162 local.get 2
163 return
164 )
165 (func (;6;) (type 3) (param i32) (result i32)
166 (local i32 i32 i32 i32 i32 i32 i32)
167 global.get 0
168 local.set 1
169 i32.const 16
170 local.set 2
171 local.get 1
172 local.get 2
173 i32.sub
174 local.set 3
175 local.get 3
176 global.set 0
177 local.get 0
178 i32.load
179 local.set 4
180 local.get 4
181 call 7
182 local.set 5
183 i32.const 16
184 local.set 6
185 local.get 3
186 local.get 6
187 i32.add
188 local.set 7
189 local.get 7
190 global.set 0
191 local.get 5
192 return
193 )
194 (func (;7;) (type 3) (param i32) (result i32)
195 (local i32 i32 i32 i32 i32 i32 i32 i32 i32)
196 global.get 0
197 local.set 1
198 i32.const 16
199 local.set 2
200 local.get 1
201 local.get 2
202 i32.sub
203 local.set 3
204 local.get 3
205 global.set 0
206 local.get 3
207 local.get 0
208 i32.store offset=8
209 i32.const 8
210 local.set 4
211 local.get 3
212 local.get 4
213 i32.add
214 local.set 5
215 local.get 5
216 local.set 6
217 local.get 6
218 call 4
219 local.set 7
220 i32.const 16
221 local.set 8
222 local.get 3
223 local.get 8
224 i32.add
225 local.set 9
226 local.get 9
227 global.set 0
228 local.get 7
229 return
230 )
231 (func (;8;) (type 0) (param i32)
232 return
233 )
234 (func (;9;) (type 5)
235 return
236 )
237 (func (;10;) (type 4) (result i32)
238 (local i32 i32 i32 i32)
239 i32.const 1
240 local.set 0
241 i32.const 0
242 local.set 1
243 i32.const 0
244 local.set 2
245 local.get 0
246 local.get 1
247 local.get 1
248 local.get 2
249 call 3
250 local.set 3
251 local.get 3
252 return
253 )
254 (elem (;0;) (i32.const 1) func 9 8 6 4)
255 (data (;0;) (i32.const 0) "\02\00\00\00\04\00\00\00\04\00\00\00\03\00\00\00\04\00\00\00\04\00\00\00")
256 (@custom "linking" (after data) "\02\08\c9\85\80\80\00\0d\00\02\01O_ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17hf1ecc3b2b910465aE\00\02\02:_ZN4core3ops8function6FnOnce9call_once17h06fc313c2ecf3d24E\00\04\03*_ZN3std2rt10lang_start17h385f18abde4350daE\02\10\00\01\02\0d.L__unnamed_1\00\00\18\00\10\00\00\02\04H_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h24681ec0ade90745E\00\02\05V_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17haa5bf2f79896d941E\00\02\06Z_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17hc804a9e31dd3115cE\00\02\07:_ZN4core3ops8function6FnOnce9call_once17h20fe7bf2b7692f9bE\00\02\08w_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h26d303f198cad6c2E\00\02\09 _ZN3foo4main17h694cf023eeafda77E\00\04\0a\0b__main_void\05\99\80\80\80\00\01\15.rodata..L__unnamed_1\02\00")
257 (@custom "reloc.CODE" (after data) "\05\19\00\06\01\07\12\03\07'\03\06/\05\07C\03\07O\03\07d\03\04\80\01\04\00\00\92\01\05\07\b5\01\03\07\c3\01\03\07\d8\01\03\00\e7\01\00\00\ed\01\07\07\a6\02\03\07\cb\02\03\07\e0\02\03\00\ef\02\09\07\84\03\03\07\92\03\03\07\a7\03\03\00\c5\03\06\07\da\03\03\01\f0\03\0b\00\88\04\02")
258 (@custom "reloc.DATA" (after data) "\06\04\02\06\0a\02\12\08\02\16\06\02\1a\06")
259 (@producers
260 (processed-by "rustc" "1.78.0 (9b00956e5 2024-04-29)")
261 )
262 (@custom "target_features" (after data) "\02+\0fmutable-globals+\08sign-ext")
263 )