]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/name-shadowing-and-scope-nesting.rs
Auto merge of #54939 - pnkfelix:issue-54478-dont-prefer-dynamic-in-doc-tests, r=Quiet...
[rust.git] / src / test / debuginfo / name-shadowing-and-scope-nesting.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 x
20 // gdb-check:$1 = false
21 // gdb-command:print y
22 // gdb-check:$2 = true
23 // gdb-command:continue
24
25 // gdb-command:print x
26 // gdb-check:$3 = 10
27 // gdb-command:print y
28 // gdb-check:$4 = true
29 // gdb-command:continue
30
31 // gdb-command:print x
32 // gdb-check:$5 = 10.5
33 // gdb-command:print y
34 // gdb-check:$6 = 20
35 // gdb-command:continue
36
37 // gdb-command:print x
38 // gdb-check:$7 = true
39 // gdb-command:print y
40 // gdb-check:$8 = 2220
41 // gdb-command:continue
42
43 // gdb-command:print x
44 // gdb-check:$9 = 203203.5
45 // gdb-command:print y
46 // gdb-check:$10 = 2220
47 // gdb-command:continue
48
49 // gdb-command:print x
50 // gdb-check:$11 = 10.5
51 // gdb-command:print y
52 // gdb-check:$12 = 20
53 // gdb-command:continue
54
55
56 // === LLDB TESTS ==================================================================================
57
58 // lldb-command:run
59
60 // lldb-command:print x
61 // lldbg-check:[...]$0 = false
62 // lldbr-check:(bool) x = false
63 // lldb-command:print y
64 // lldbg-check:[...]$1 = true
65 // lldbr-check:(bool) y = true
66 // lldb-command:continue
67
68 // lldb-command:print x
69 // lldbg-check:[...]$2 = 10
70 // lldbr-check:(i32) x = 10
71 // lldb-command:print y
72 // lldbg-check:[...]$3 = true
73 // lldbr-check:(bool) y = true
74 // lldb-command:continue
75
76 // lldb-command:print x
77 // lldbg-check:[...]$4 = 10.5
78 // lldbr-check:(f64) x = 10.5
79 // lldb-command:print y
80 // lldbg-check:[...]$5 = 20
81 // lldbr-check:(i32) y = 20
82 // lldb-command:continue
83
84 // lldb-command:print x
85 // lldbg-check:[...]$6 = true
86 // lldbr-check:(bool) x = true
87 // lldb-command:print y
88 // lldbg-check:[...]$7 = 2220
89 // lldbr-check:(i32) y = 2220
90 // lldb-command:continue
91
92 // lldb-command:print x
93 // lldbg-check:[...]$8 = 203203.5
94 // lldbr-check:(f64) x = 203203.5
95 // lldb-command:print y
96 // lldbg-check:[...]$9 = 2220
97 // lldbr-check:(i32) y = 2220
98 // lldb-command:continue
99
100 // lldb-command:print x
101 // lldbg-check:[...]$10 = 10.5
102 // lldbr-check:(f64) x = 10.5
103 // lldb-command:print y
104 // lldbg-check:[...]$11 = 20
105 // lldbr-check:(i32) y = 20
106 // lldb-command:continue
107
108 #![feature(omit_gdb_pretty_printer_section)]
109 #![omit_gdb_pretty_printer_section]
110
111 fn main() {
112     let x = false;
113     let y = true;
114
115     zzz(); // #break
116     sentinel();
117
118     let x = 10;
119
120     zzz(); // #break
121     sentinel();
122
123     let x = 10.5f64;
124     let y = 20;
125
126     zzz(); // #break
127     sentinel();
128
129     {
130         let x = true;
131         let y = 2220;
132
133         zzz(); // #break
134         sentinel();
135
136         let x = 203203.5f64;
137
138         zzz(); // #break
139         sentinel();
140     }
141
142     zzz(); // #break
143     sentinel();
144 }
145
146 fn zzz() {()}
147 fn sentinel() {()}