]> git.proxmox.com Git - rustc.git/blame - src/test/debuginfo/shadowed-variable.rs
New upstream version 1.31.0~beta.4+dfsg1
[rustc.git] / src / test / debuginfo / shadowed-variable.rs
CommitLineData
1a4d82fc
JJ
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
1a4d82fc 11// min-lldb-version: 310
1a4d82fc
JJ
12// compile-flags:-g
13
14// === GDB TESTS ===================================================================================
15
16// gdb-command:run
17
18// gdb-command:print x
19// gdb-check:$1 = false
20// gdb-command:print y
21// gdb-check:$2 = true
22// gdb-command:continue
23
24// gdb-command:print x
25// gdb-check:$3 = 10
26// gdb-command:print y
27// gdb-check:$4 = true
28// gdb-command:continue
29
30// gdb-command:print x
31// gdb-check:$5 = 10.5
32// gdb-command:print y
33// gdb-check:$6 = 20
34// gdb-command:continue
35
ff7c6d11 36// gdb-command:print x
2c00a5a8 37// gdb-check:$7 = 10.5
ff7c6d11 38// gdb-command:print y
2c00a5a8 39// gdb-check:$8 = 20
ff7c6d11
XL
40// gdb-command:continue
41
42// gdb-command:print x
2c00a5a8 43// gdb-check:$9 = 11.5
ff7c6d11 44// gdb-command:print y
2c00a5a8 45// gdb-check:$10 = 20
ff7c6d11 46// gdb-command:continue
1a4d82fc
JJ
47
48// === LLDB TESTS ==================================================================================
49
50// lldb-command:run
51
52// lldb-command:print x
0bf4aa26
XL
53// lldbg-check:[...]$0 = false
54// lldbr-check:(bool) x = false
1a4d82fc 55// lldb-command:print y
0bf4aa26
XL
56// lldbg-check:[...]$1 = true
57// lldbr-check:(bool) y = true
1a4d82fc
JJ
58// lldb-command:continue
59
60// lldb-command:print x
0bf4aa26
XL
61// lldbg-check:[...]$2 = 10
62// lldbr-check:(i32) x = 10
1a4d82fc 63// lldb-command:print y
0bf4aa26
XL
64// lldbg-check:[...]$3 = true
65// lldbr-check:(bool) y = true
1a4d82fc
JJ
66// lldb-command:continue
67
68// lldb-command:print x
0bf4aa26
XL
69// lldbg-check:[...]$4 = 10.5
70// lldbr-check:(f64) x = 10.5
1a4d82fc 71// lldb-command:print y
0bf4aa26
XL
72// lldbg-check:[...]$5 = 20
73// lldbr-check:(i32) y = 20
1a4d82fc
JJ
74// lldb-command:continue
75
ff7c6d11 76// lldb-command:print x
0bf4aa26
XL
77// lldbg-check:[...]$6 = 10.5
78// lldbr-check:(f64) x = 10.5
ff7c6d11 79// lldb-command:print y
0bf4aa26
XL
80// lldbg-check:[...]$7 = 20
81// lldbr-check:(i32) y = 20
ff7c6d11
XL
82// lldb-command:continue
83
84// lldb-command:print x
0bf4aa26
XL
85// lldbg-check:[...]$8 = 11.5
86// lldbr-check:(f64) x = 11.5
ff7c6d11 87// lldb-command:print y
0bf4aa26
XL
88// lldbg-check:[...]$9 = 20
89// lldbr-check:(i32) y = 20
ff7c6d11
XL
90// lldb-command:continue
91
b039eaaf 92#![feature(omit_gdb_pretty_printer_section)]
1a4d82fc
JJ
93#![omit_gdb_pretty_printer_section]
94
95fn main() {
96 let x = false;
97 let y = true;
98
99 zzz(); // #break
100 sentinel();
101
85aaf69f 102 let x = 10;
1a4d82fc
JJ
103
104 zzz(); // #break
105 sentinel();
106
107 let x = 10.5f64;
85aaf69f 108 let y = 20;
1a4d82fc
JJ
109
110 zzz(); // #break
111 sentinel();
ff7c6d11
XL
112
113 let x = {
114 zzz(); // #break
115 sentinel();
116 11.5
117 };
118
119 zzz(); // #break
120 sentinel()
1a4d82fc
JJ
121}
122
123fn zzz() {()}
124fn sentinel() {()}