]>
git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/lexical-scopes-in-block-expression.rs
1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // min-lldb-version: 310
12 // ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
16 // === GDB TESTS ===================================================================================
20 // gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
21 // gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
25 // gdb-command:print val
27 // gdb-command:print ten
29 // gdb-command:continue
31 // gdb-command:print val
33 // gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
34 // gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
36 // gdb-command:print ten
38 // gdb-command:continue
40 // gdb-command:print val
42 // gdb-command:print ten
44 // gdb-command:continue
47 // gdb-command:print val
49 // gdb-command:print ten
51 // gdb-command:continue
53 // gdb-command:print val
55 // gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
56 // gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
58 // gdb-command:print ten
60 // gdb-command:continue
62 // gdb-command:print val
64 // gdb-command:print ten
66 // gdb-command:continue
69 // gdb-command:print val
71 // gdb-command:print ten
73 // gdb-command:continue
75 // gdb-command:print val
77 // gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
78 // gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
80 // gdb-command:print ten
82 // gdb-command:continue
84 // gdb-command:print val
86 // gdb-command:print ten
88 // gdb-command:continue
91 // gdb-command:print val
93 // gdb-command:print ten
95 // gdb-command:continue
97 // gdb-command:print val
99 // gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
100 // gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
102 // gdb-command:print ten
103 // gdb-check:$27 = 10
104 // gdb-command:continue
106 // gdb-command:print val
107 // gdb-check:$28 = -1
108 // gdb-command:print ten
109 // gdb-check:$29 = 10
110 // gdb-command:continue
112 // REPEAT VEC EXPRESSION
113 // gdb-command:print val
114 // gdb-check:$30 = -1
115 // gdb-command:print ten
116 // gdb-check:$31 = 10
117 // gdb-command:continue
119 // gdb-command:print val
120 // gdb-check:$32 = 15
121 // gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
122 // gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
124 // gdb-command:print ten
125 // gdb-check:$34 = 10
126 // gdb-command:continue
128 // gdb-command:print val
129 // gdb-check:$35 = -1
130 // gdb-command:print ten
131 // gdb-check:$36 = 10
132 // gdb-command:continue
134 // ASSIGNMENT EXPRESSION
135 // gdb-command:print val
136 // gdb-check:$37 = -1
137 // gdb-command:print ten
138 // gdb-check:$38 = 10
139 // gdb-command:continue
141 // gdb-command:print val
142 // gdb-check:$39 = 16
143 // gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
144 // gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
146 // gdb-command:print ten
147 // gdb-check:$41 = 10
148 // gdb-command:continue
150 // gdb-command:print val
151 // gdb-check:$42 = -1
152 // gdb-command:print ten
153 // gdb-check:$43 = 10
154 // gdb-command:continue
157 // ARITHMETIC EXPRESSION
158 // gdb-command:print val
159 // gdb-check:$44 = -1
160 // gdb-command:print ten
161 // gdb-check:$45 = 10
162 // gdb-command:continue
164 // gdb-command:print val
165 // gdb-check:$46 = 17
166 // gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
167 // gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
169 // gdb-command:print ten
170 // gdb-check:$48 = 10
171 // gdb-command:continue
173 // gdb-command:print val
174 // gdb-check:$49 = -1
175 // gdb-command:print ten
176 // gdb-check:$50 = 10
177 // gdb-command:continue
180 // gdb-command:print val
181 // gdb-check:$51 = -1
182 // gdb-command:print ten
183 // gdb-check:$52 = 10
184 // gdb-command:continue
186 // gdb-command:print val
187 // gdb-check:$53 = 18
188 // gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
189 // gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
191 // gdb-command:print ten
192 // gdb-check:$55 = 10
193 // gdb-command:continue
195 // gdb-command:print val
196 // gdb-check:$56 = -1
197 // gdb-command:print ten
198 // gdb-check:$57 = 10
199 // gdb-command:continue
202 // === LLDB TESTS ==================================================================================
207 // lldb-command:print val
208 // lldb-check:[...]$0 = -1
209 // lldb-command:print ten
210 // lldb-check:[...]$1 = 10
211 // lldb-command:continue
213 // lldb-command:print val
214 // lldb-check:[...]$2 = 11
215 // lldb-command:print ten
216 // lldb-check:[...]$3 = 10
217 // lldb-command:continue
219 // lldb-command:print val
220 // lldb-check:[...]$4 = -1
221 // lldb-command:print ten
222 // lldb-check:[...]$5 = 10
223 // lldb-command:continue
226 // lldb-command:print val
227 // lldb-check:[...]$6 = -1
228 // lldb-command:print ten
229 // lldb-check:[...]$7 = 10
230 // lldb-command:continue
232 // lldb-command:print val
233 // lldb-check:[...]$8 = 12
234 // lldb-command:print ten
235 // lldb-check:[...]$9 = 10
236 // lldb-command:continue
238 // lldb-command:print val
239 // lldb-check:[...]$10 = -1
240 // lldb-command:print ten
241 // lldb-check:[...]$11 = 10
242 // lldb-command:continue
245 // lldb-command:print val
246 // lldb-check:[...]$12 = -1
247 // lldb-command:print ten
248 // lldb-check:[...]$13 = 10
249 // lldb-command:continue
251 // lldb-command:print val
252 // lldb-check:[...]$14 = 13
253 // lldb-command:print ten
254 // lldb-check:[...]$15 = 10
255 // lldb-command:continue
257 // lldb-command:print val
258 // lldb-check:[...]$16 = -1
259 // lldb-command:print ten
260 // lldb-check:[...]$17 = 10
261 // lldb-command:continue
264 // lldb-command:print val
265 // lldb-check:[...]$18 = -1
266 // lldb-command:print ten
267 // lldb-check:[...]$19 = 10
268 // lldb-command:continue
270 // lldb-command:print val
271 // lldb-check:[...]$20 = 14
272 // lldb-command:print ten
273 // lldb-check:[...]$21 = 10
274 // lldb-command:continue
276 // lldb-command:print val
277 // lldb-check:[...]$22 = -1
278 // lldb-command:print ten
279 // lldb-check:[...]$23 = 10
280 // lldb-command:continue
282 // REPEAT VEC EXPRESSION
283 // lldb-command:print val
284 // lldb-check:[...]$24 = -1
285 // lldb-command:print ten
286 // lldb-check:[...]$25 = 10
287 // lldb-command:continue
289 // lldb-command:print val
290 // lldb-check:[...]$26 = 15
291 // lldb-command:print ten
292 // lldb-check:[...]$27 = 10
293 // lldb-command:continue
295 // lldb-command:print val
296 // lldb-check:[...]$28 = -1
297 // lldb-command:print ten
298 // lldb-check:[...]$29 = 10
299 // lldb-command:continue
301 // ASSIGNMENT EXPRESSION
302 // lldb-command:print val
303 // lldb-check:[...]$30 = -1
304 // lldb-command:print ten
305 // lldb-check:[...]$31 = 10
306 // lldb-command:continue
308 // lldb-command:print val
309 // lldb-check:[...]$32 = 16
310 // lldb-command:print ten
311 // lldb-check:[...]$33 = 10
312 // lldb-command:continue
314 // lldb-command:print val
315 // lldb-check:[...]$34 = -1
316 // lldb-command:print ten
317 // lldb-check:[...]$35 = 10
318 // lldb-command:continue
321 // ARITHMETIC EXPRESSION
322 // lldb-command:print val
323 // lldb-check:[...]$36 = -1
324 // lldb-command:print ten
325 // lldb-check:[...]$37 = 10
326 // lldb-command:continue
328 // lldb-command:print val
329 // lldb-check:[...]$38 = 17
330 // lldb-command:print ten
331 // lldb-check:[...]$39 = 10
332 // lldb-command:continue
334 // lldb-command:print val
335 // lldb-check:[...]$40 = -1
336 // lldb-command:print ten
337 // lldb-check:[...]$41 = 10
338 // lldb-command:continue
341 // lldb-command:print val
342 // lldb-check:[...]$42 = -1
343 // lldb-command:print ten
344 // lldb-check:[...]$43 = 10
345 // lldb-command:continue
347 // lldb-command:print val
348 // lldb-check:[...]$44 = 18
349 // lldb-command:print ten
350 // lldb-check:[...]$45 = 10
351 // lldb-command:continue
353 // lldb-command:print val
354 // lldb-check:[...]$46 = -1
355 // lldb-command:print ten
356 // lldb-check:[...]$47 = 10
357 // lldb-command:continue
359 #![allow(unused_variables)]
360 #![allow(unused_assignments)]
361 #![feature(omit_gdb_pretty_printer_section)]
362 #![omit_gdb_pretty_printer_section]
364 static mut MUT_INT
: isize = 0;
371 fn a_function(x
: isize) -> isize {
380 // surrounded by struct expression
387 unsafe {MUT_INT = 1;}
;
400 // surrounded by function call
406 unsafe {MUT_INT = 2;}
;
424 unsafe {MUT_INT = 3;}
;
441 unsafe {MUT_INT = 4;}
;
452 // surrounded by repeat vec
458 unsafe {MUT_INT = 5;}
;
469 // assignment expression
476 unsafe {MUT_INT = 6;}
;
487 // arithmetic expression
493 unsafe {MUT_INT = 7;}
;
505 let a_vector
= [10; 20];
511 unsafe {MUT_INT = 8;}
;