]> git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/lexical-scope-in-match.rs
c2cddd25768598f67910ee7883feba7a70c6b1f3
[rustc.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 // lldb-check:[...]$0 = 231
78 // lldb-command:print not_shadowed
79 // lldb-check:[...]$1 = 232
80 // lldb-command:continue
81
82 // lldb-command:print shadowed
83 // lldb-check:[...]$2 = 233
84 // lldb-command:print not_shadowed
85 // lldb-check:[...]$3 = 232
86 // lldb-command:print local_to_arm
87 // lldb-check:[...]$4 = 234
88 // lldb-command:continue
89
90 // lldb-command:print shadowed
91 // lldb-check:[...]$5 = 236
92 // lldb-command:print not_shadowed
93 // lldb-check:[...]$6 = 232
94 // lldb-command:continue
95
96 // lldb-command:print shadowed
97 // lldb-check:[...]$7 = 237
98 // lldb-command:print not_shadowed
99 // lldb-check:[...]$8 = 232
100 // lldb-command:print local_to_arm
101 // lldb-check:[...]$9 = 238
102 // lldb-command:continue
103
104 // lldb-command:print shadowed
105 // lldb-check:[...]$10 = 239
106 // lldb-command:print not_shadowed
107 // lldb-check:[...]$11 = 232
108 // lldb-command:continue
109
110 // lldb-command:print shadowed
111 // lldb-check:[...]$12 = 241
112 // lldb-command:print not_shadowed
113 // lldb-check:[...]$13 = 232
114 // lldb-command:continue
115
116 // lldb-command:print shadowed
117 // lldb-check:[...]$14 = 243
118 // lldb-command:print *local_to_arm
119 // lldb-check:[...]$15 = 244
120 // lldb-command:continue
121
122 // lldb-command:print shadowed
123 // lldb-check:[...]$16 = 231
124 // lldb-command:print not_shadowed
125 // lldb-check:[...]$17 = 232
126 // lldb-command:continue
127
128 #![omit_gdb_pretty_printer_section]
129
130 struct Struct {
131 x: int,
132 y: int
133 }
134
135 fn main() {
136
137 let shadowed = 231;
138 let not_shadowed = 232;
139
140 zzz(); // #break
141 sentinel();
142
143 match (233, 234) {
144 (shadowed, local_to_arm) => {
145
146 zzz(); // #break
147 sentinel();
148 }
149 }
150
151 match (235, 236) {
152 // with literal
153 (235, shadowed) => {
154
155 zzz(); // #break
156 sentinel();
157 }
158 _ => {}
159 }
160
161 match (Struct { x: 237, y: 238 }) {
162 Struct { x: shadowed, y: local_to_arm } => {
163
164 zzz(); // #break
165 sentinel();
166 }
167 }
168
169 match (Struct { x: 239, y: 240 }) {
170 // ignored field
171 Struct { x: shadowed, .. } => {
172
173 zzz(); // #break
174 sentinel();
175 }
176 }
177
178 match (Struct { x: 241, y: 242 }) {
179 // with literal
180 Struct { x: shadowed, y: 242 } => {
181
182 zzz(); // #break
183 sentinel();
184 }
185 _ => {}
186 }
187
188 match (243, 244) {
189 (shadowed, ref local_to_arm) => {
190
191 zzz(); // #break
192 sentinel();
193 }
194 }
195
196 zzz(); // #break
197 sentinel();
198 }
199
200 fn zzz() {()}
201 fn sentinel() {()}