]> git.proxmox.com Git - rustc.git/blame - src/test/debuginfo/lexical-scope-in-while.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / debuginfo / lexical-scope-in-while.rs
CommitLineData
1a4d82fc
JJ
1// min-lldb-version: 310
2
3// compile-flags:-g
4
5// === GDB TESTS ===================================================================================
6
7// gdb-command:run
8
9// FIRST ITERATION
10// gdb-command:print x
11// gdb-check:$1 = 0
12// gdb-command:continue
13
14// gdb-command:print x
15// gdb-check:$2 = 1
16// gdb-command:continue
17
18// gdb-command:print x
19// gdb-check:$3 = 101
20// gdb-command:continue
21
22// gdb-command:print x
23// gdb-check:$4 = 101
24// gdb-command:continue
25
26// gdb-command:print x
27// gdb-check:$5 = -987
28// gdb-command:continue
29
30// gdb-command:print x
31// gdb-check:$6 = 101
32// gdb-command:continue
33
34
35// SECOND ITERATION
36// gdb-command:print x
37// gdb-check:$7 = 1
38// gdb-command:continue
39
40// gdb-command:print x
41// gdb-check:$8 = 2
42// gdb-command:continue
43
44// gdb-command:print x
45// gdb-check:$9 = 102
46// gdb-command:continue
47
48// gdb-command:print x
49// gdb-check:$10 = 102
50// gdb-command:continue
51
52// gdb-command:print x
53// gdb-check:$11 = -987
54// gdb-command:continue
55
56// gdb-command:print x
57// gdb-check:$12 = 102
58// gdb-command:continue
59
60// gdb-command:print x
61// gdb-check:$13 = 2
62// gdb-command:continue
63
64
65// === LLDB TESTS ==================================================================================
66
67// lldb-command:run
68
69// FIRST ITERATION
70// lldb-command:print x
0bf4aa26
XL
71// lldbg-check:[...]$0 = 0
72// lldbr-check:(i32) x = 0
1a4d82fc
JJ
73// lldb-command:continue
74
75// lldb-command:print x
0bf4aa26
XL
76// lldbg-check:[...]$1 = 1
77// lldbr-check:(i32) x = 1
1a4d82fc
JJ
78// lldb-command:continue
79
80// lldb-command:print x
0bf4aa26
XL
81// lldbg-check:[...]$2 = 101
82// lldbr-check:(i32) x = 101
1a4d82fc
JJ
83// lldb-command:continue
84
85// lldb-command:print x
0bf4aa26
XL
86// lldbg-check:[...]$3 = 101
87// lldbr-check:(i32) x = 101
1a4d82fc
JJ
88// lldb-command:continue
89
90// lldb-command:print x
0bf4aa26
XL
91// lldbg-check:[...]$4 = -987
92// lldbr-check:(i32) x = -987
1a4d82fc
JJ
93// lldb-command:continue
94
95// lldb-command:print x
0bf4aa26
XL
96// lldbg-check:[...]$5 = 101
97// lldbr-check:(i32) x = 101
1a4d82fc
JJ
98// lldb-command:continue
99
100
101// SECOND ITERATION
102// lldb-command:print x
0bf4aa26
XL
103// lldbg-check:[...]$6 = 1
104// lldbr-check:(i32) x = 1
1a4d82fc
JJ
105// lldb-command:continue
106
107// lldb-command:print x
0bf4aa26
XL
108// lldbg-check:[...]$7 = 2
109// lldbr-check:(i32) x = 2
1a4d82fc
JJ
110// lldb-command:continue
111
112// lldb-command:print x
0bf4aa26
XL
113// lldbg-check:[...]$8 = 102
114// lldbr-check:(i32) x = 102
1a4d82fc
JJ
115// lldb-command:continue
116
117// lldb-command:print x
0bf4aa26
XL
118// lldbg-check:[...]$9 = 102
119// lldbr-check:(i32) x = 102
1a4d82fc
JJ
120// lldb-command:continue
121
122// lldb-command:print x
0bf4aa26
XL
123// lldbg-check:[...]$10 = -987
124// lldbr-check:(i32) x = -987
1a4d82fc
JJ
125// lldb-command:continue
126
127// lldb-command:print x
0bf4aa26
XL
128// lldbg-check:[...]$11 = 102
129// lldbr-check:(i32) x = 102
1a4d82fc
JJ
130// lldb-command:continue
131
132// lldb-command:print x
0bf4aa26
XL
133// lldbg-check:[...]$12 = 2
134// lldbr-check:(i32) x = 2
1a4d82fc
JJ
135// lldb-command:continue
136
b039eaaf 137#![feature(omit_gdb_pretty_printer_section)]
1a4d82fc
JJ
138#![omit_gdb_pretty_printer_section]
139
140fn main() {
141
85aaf69f 142 let mut x = 0;
1a4d82fc
JJ
143
144 while x < 2 {
145 zzz(); // #break
146 sentinel();
147
148 x += 1;
149 zzz(); // #break
150 sentinel();
151
152 // Shadow x
153 let x = x + 100;
154 zzz(); // #break
155 sentinel();
156
157 // open scope within loop's top level scope
158 {
159 zzz(); // #break
160 sentinel();
161
85aaf69f 162 let x = -987;
1a4d82fc
JJ
163
164 zzz(); // #break
165 sentinel();
166 }
167
168 // Check that we get the x before the inner scope again
169 zzz(); // #break
170 sentinel();
171 }
172
173 zzz(); // #break
174 sentinel();
175}
176
177fn zzz() {()}
178fn sentinel() {()}