]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/lexical-scope-in-match.rs
Auto merge of #54490 - wesleywiser:rewrite_it_in_mir, r=oli-obk
[rust.git] / src / test / debuginfo / lexical-scope-in-match.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 // min-lldb-version: 310
12
13 // compile-flags:-g
14
15 // === GDB TESTS ===================================================================================
16
17 // gdb-command:run
18
19 // gdb-command:print shadowed
20 // gdb-check:$1 = 231
21 // gdb-command:print not_shadowed
22 // gdb-check:$2 = 232
23 // gdb-command:continue
24
25 // gdb-command:print shadowed
26 // gdb-check:$3 = 233
27 // gdb-command:print not_shadowed
28 // gdb-check:$4 = 232
29 // gdb-command:print local_to_arm
30 // gdb-check:$5 = 234
31 // gdb-command:continue
32
33 // gdb-command:print shadowed
34 // gdb-check:$6 = 236
35 // gdb-command:print not_shadowed
36 // gdb-check:$7 = 232
37 // gdb-command:continue
38
39 // gdb-command:print shadowed
40 // gdb-check:$8 = 237
41 // gdb-command:print not_shadowed
42 // gdb-check:$9 = 232
43 // gdb-command:print local_to_arm
44 // gdb-check:$10 = 238
45 // gdb-command:continue
46
47 // gdb-command:print shadowed
48 // gdb-check:$11 = 239
49 // gdb-command:print not_shadowed
50 // gdb-check:$12 = 232
51 // gdb-command:continue
52
53 // gdb-command:print shadowed
54 // gdb-check:$13 = 241
55 // gdb-command:print not_shadowed
56 // gdb-check:$14 = 232
57 // gdb-command:continue
58
59 // gdb-command:print shadowed
60 // gdb-check:$15 = 243
61 // gdb-command:print *local_to_arm
62 // gdb-check:$16 = 244
63 // gdb-command:continue
64
65 // gdb-command:print shadowed
66 // gdb-check:$17 = 231
67 // gdb-command:print not_shadowed
68 // gdb-check:$18 = 232
69 // gdb-command:continue
70
71
72 // === LLDB TESTS ==================================================================================
73
74 // lldb-command:run
75
76 // lldb-command:print shadowed
77 // lldbg-check:[...]$0 = 231
78 // lldbr-check:(i32) shadowed = 231
79 // lldb-command:print not_shadowed
80 // lldbg-check:[...]$1 = 232
81 // lldbr-check:(i32) not_shadowed = 232
82 // lldb-command:continue
83
84 // lldb-command:print shadowed
85 // lldbg-check:[...]$2 = 233
86 // lldbr-check:(i32) shadowed = 233
87 // lldb-command:print not_shadowed
88 // lldbg-check:[...]$3 = 232
89 // lldbr-check:(i32) not_shadowed = 232
90 // lldb-command:print local_to_arm
91 // lldbg-check:[...]$4 = 234
92 // lldbr-check:(i32) local_to_arm = 234
93 // lldb-command:continue
94
95 // lldb-command:print shadowed
96 // lldbg-check:[...]$5 = 236
97 // lldbr-check:(i32) shadowed = 236
98 // lldb-command:print not_shadowed
99 // lldbg-check:[...]$6 = 232
100 // lldbr-check:(i32) not_shadowed = 232
101 // lldb-command:continue
102
103 // lldb-command:print shadowed
104 // lldbg-check:[...]$7 = 237
105 // lldbr-check:(isize) shadowed = 237
106 // lldb-command:print not_shadowed
107 // lldbg-check:[...]$8 = 232
108 // lldbr-check:(i32) not_shadowed = 232
109 // lldb-command:print local_to_arm
110 // lldbg-check:[...]$9 = 238
111 // lldbr-check:(isize) local_to_arm = 238
112 // lldb-command:continue
113
114 // lldb-command:print shadowed
115 // lldbg-check:[...]$10 = 239
116 // lldbr-check:(isize) shadowed = 239
117 // lldb-command:print not_shadowed
118 // lldbg-check:[...]$11 = 232
119 // lldbr-check:(i32) not_shadowed = 232
120 // lldb-command:continue
121
122 // lldb-command:print shadowed
123 // lldbg-check:[...]$12 = 241
124 // lldbr-check:(isize) shadowed = 241
125 // lldb-command:print not_shadowed
126 // lldbg-check:[...]$13 = 232
127 // lldbr-check:(i32) not_shadowed = 232
128 // lldb-command:continue
129
130 // lldb-command:print shadowed
131 // lldbg-check:[...]$14 = 243
132 // lldbr-check:(i32) shadowed = 243
133 // lldb-command:print *local_to_arm
134 // lldbg-check:[...]$15 = 244
135 // lldbr-check:(i32) *local_to_arm = 244
136 // lldb-command:continue
137
138 // lldb-command:print shadowed
139 // lldbg-check:[...]$16 = 231
140 // lldbr-check:(i32) shadowed = 231
141 // lldb-command:print not_shadowed
142 // lldbg-check:[...]$17 = 232
143 // lldbr-check:(i32) not_shadowed = 232
144 // lldb-command:continue
145
146 #![feature(omit_gdb_pretty_printer_section)]
147 #![omit_gdb_pretty_printer_section]
148
149 struct Struct {
150     x: isize,
151     y: isize
152 }
153
154 fn main() {
155
156     let shadowed = 231;
157     let not_shadowed = 232;
158
159     zzz(); // #break
160     sentinel();
161
162     match (233, 234) {
163         (shadowed, local_to_arm) => {
164
165             zzz(); // #break
166             sentinel();
167         }
168     }
169
170     match (235, 236) {
171         // with literal
172         (235, shadowed) => {
173
174             zzz(); // #break
175             sentinel();
176         }
177         _ => {}
178     }
179
180     match (Struct { x: 237, y: 238 }) {
181         Struct { x: shadowed, y: local_to_arm } => {
182
183             zzz(); // #break
184             sentinel();
185         }
186     }
187
188     match (Struct { x: 239, y: 240 }) {
189         // ignored field
190         Struct { x: shadowed, .. } => {
191
192             zzz(); // #break
193             sentinel();
194         }
195     }
196
197     match (Struct { x: 241, y: 242 }) {
198         // with literal
199         Struct { x: shadowed, y: 242 } => {
200
201             zzz(); // #break
202             sentinel();
203         }
204         _ => {}
205     }
206
207     match (243, 244) {
208         (shadowed, ref local_to_arm) => {
209
210             zzz(); // #break
211             sentinel();
212         }
213     }
214
215     zzz(); // #break
216     sentinel();
217 }
218
219 fn zzz() {()}
220 fn sentinel() {()}