]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/lexical-scope-in-if.rs
Add verbose option to rustdoc in order to fix problem with --version
[rust.git] / src / test / debuginfo / lexical-scope-in-if.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.
4 //
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.
10
11 // ignore-android: FIXME(#10381)
12 // min-lldb-version: 310
13
14 // compile-flags:-g
15
16 // === GDB TESTS ===================================================================================
17
18 // gdb-command:run
19
20 // BEFORE if
21 // gdb-command:print x
22 // gdb-check:$1 = 999
23 // gdb-command:print y
24 // gdb-check:$2 = -1
25 // gdb-command:continue
26
27 // AT BEGINNING of 'then' block
28 // gdb-command:print x
29 // gdb-check:$3 = 999
30 // gdb-command:print y
31 // gdb-check:$4 = -1
32 // gdb-command:continue
33
34 // AFTER 1st redeclaration of 'x'
35 // gdb-command:print x
36 // gdb-check:$5 = 1001
37 // gdb-command:print y
38 // gdb-check:$6 = -1
39 // gdb-command:continue
40
41 // AFTER 2st redeclaration of 'x'
42 // gdb-command:print x
43 // gdb-check:$7 = 1002
44 // gdb-command:print y
45 // gdb-check:$8 = 1003
46 // gdb-command:continue
47
48 // AFTER 1st if expression
49 // gdb-command:print x
50 // gdb-check:$9 = 999
51 // gdb-command:print y
52 // gdb-check:$10 = -1
53 // gdb-command:continue
54
55 // BEGINNING of else branch
56 // gdb-command:print x
57 // gdb-check:$11 = 999
58 // gdb-command:print y
59 // gdb-check:$12 = -1
60 // gdb-command:continue
61
62 // BEGINNING of else branch
63 // gdb-command:print x
64 // gdb-check:$13 = 1004
65 // gdb-command:print y
66 // gdb-check:$14 = 1005
67 // gdb-command:continue
68
69 // BEGINNING of else branch
70 // gdb-command:print x
71 // gdb-check:$15 = 999
72 // gdb-command:print y
73 // gdb-check:$16 = -1
74 // gdb-command:continue
75
76
77 // === LLDB TESTS ==================================================================================
78
79 // lldb-command:run
80
81 // BEFORE if
82 // lldb-command:print x
83 // lldb-check:[...]$0 = 999
84 // lldb-command:print y
85 // lldb-check:[...]$1 = -1
86 // lldb-command:continue
87
88 // AT BEGINNING of 'then' block
89 // lldb-command:print x
90 // lldb-check:[...]$2 = 999
91 // lldb-command:print y
92 // lldb-check:[...]$3 = -1
93 // lldb-command:continue
94
95 // AFTER 1st redeclaration of 'x'
96 // lldb-command:print x
97 // lldb-check:[...]$4 = 1001
98 // lldb-command:print y
99 // lldb-check:[...]$5 = -1
100 // lldb-command:continue
101
102 // AFTER 2st redeclaration of 'x'
103 // lldb-command:print x
104 // lldb-check:[...]$6 = 1002
105 // lldb-command:print y
106 // lldb-check:[...]$7 = 1003
107 // lldb-command:continue
108
109 // AFTER 1st if expression
110 // lldb-command:print x
111 // lldb-check:[...]$8 = 999
112 // lldb-command:print y
113 // lldb-check:[...]$9 = -1
114 // lldb-command:continue
115
116 // BEGINNING of else branch
117 // lldb-command:print x
118 // lldb-check:[...]$10 = 999
119 // lldb-command:print y
120 // lldb-check:[...]$11 = -1
121 // lldb-command:continue
122
123 // BEGINNING of else branch
124 // lldb-command:print x
125 // lldb-check:[...]$12 = 1004
126 // lldb-command:print y
127 // lldb-check:[...]$13 = 1005
128 // lldb-command:continue
129
130 // BEGINNING of else branch
131 // lldb-command:print x
132 // lldb-check:[...]$14 = 999
133 // lldb-command:print y
134 // lldb-check:[...]$15 = -1
135 // lldb-command:continue
136
137
138 fn main() {
139
140     let x = 999i;
141     let y = -1i;
142
143     zzz(); // #break
144     sentinel();
145
146     if x < 1000 {
147         zzz(); // #break
148         sentinel();
149
150         let x = 1001i;
151
152         zzz(); // #break
153         sentinel();
154
155         let x = 1002i;
156         let y = 1003i;
157         zzz(); // #break
158         sentinel();
159     } else {
160         unreachable!();
161     }
162
163     zzz(); // #break
164     sentinel();
165
166     if x > 1000 {
167         unreachable!();
168     } else {
169         zzz(); // #break
170         sentinel();
171
172         let x = 1004i;
173         let y = 1005i;
174         zzz(); // #break
175         sentinel();
176     }
177
178     zzz(); // #break
179     sentinel();
180 }
181
182 fn zzz() {()}
183 fn sentinel() {()}