]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/shadowed-variable.rs
Merge commit '7d53619064ab7045c383644cb445052d2a3d46db' into sync_cg_clif-2023-02-09
[rust.git] / tests / debuginfo / shadowed-variable.rs
1 // min-lldb-version: 310
2 // compile-flags:-g
3
4 // === GDB TESTS ===================================================================================
5
6 // gdb-command:run
7
8 // gdb-command:print x
9 // gdb-check:$1 = false
10 // gdb-command:print y
11 // gdb-check:$2 = true
12 // gdb-command:continue
13
14 // gdb-command:print x
15 // gdb-check:$3 = 10
16 // gdb-command:print y
17 // gdb-check:$4 = true
18 // gdb-command:continue
19
20 // gdb-command:print x
21 // gdb-check:$5 = 10.5
22 // gdb-command:print y
23 // gdb-check:$6 = 20
24 // gdb-command:continue
25
26 // gdb-command:print x
27 // gdb-check:$7 = 10.5
28 // gdb-command:print y
29 // gdb-check:$8 = 20
30 // gdb-command:continue
31
32 // gdb-command:print x
33 // gdb-check:$9 = 11.5
34 // gdb-command:print y
35 // gdb-check:$10 = 20
36 // gdb-command:continue
37
38 // === LLDB TESTS ==================================================================================
39
40 // lldb-command:run
41
42 // lldb-command:print x
43 // lldbg-check:[...]$0 = false
44 // lldbr-check:(bool) x = false
45 // lldb-command:print y
46 // lldbg-check:[...]$1 = true
47 // lldbr-check:(bool) y = true
48 // lldb-command:continue
49
50 // lldb-command:print x
51 // lldbg-check:[...]$2 = 10
52 // lldbr-check:(i32) x = 10
53 // lldb-command:print y
54 // lldbg-check:[...]$3 = true
55 // lldbr-check:(bool) y = true
56 // lldb-command:continue
57
58 // lldb-command:print x
59 // lldbg-check:[...]$4 = 10.5
60 // lldbr-check:(f64) x = 10.5
61 // lldb-command:print y
62 // lldbg-check:[...]$5 = 20
63 // lldbr-check:(i32) y = 20
64 // lldb-command:continue
65
66 // lldb-command:print x
67 // lldbg-check:[...]$6 = 10.5
68 // lldbr-check:(f64) x = 10.5
69 // lldb-command:print y
70 // lldbg-check:[...]$7 = 20
71 // lldbr-check:(i32) y = 20
72 // lldb-command:continue
73
74 // lldb-command:print x
75 // lldbg-check:[...]$8 = 11.5
76 // lldbr-check:(f64) x = 11.5
77 // lldb-command:print y
78 // lldbg-check:[...]$9 = 20
79 // lldbr-check:(i32) y = 20
80 // lldb-command:continue
81
82 #![feature(omit_gdb_pretty_printer_section)]
83 #![omit_gdb_pretty_printer_section]
84
85 fn main() {
86     let x = false;
87     let y = true;
88
89     zzz(); // #break
90     sentinel();
91
92     let x = 10;
93
94     zzz(); // #break
95     sentinel();
96
97     let x = 10.5f64;
98     let y = 20;
99
100     zzz(); // #break
101     sentinel();
102
103     let x = {
104         zzz(); // #break
105         sentinel();
106         11.5
107     };
108
109     zzz(); // #break
110     sentinel()
111 }
112
113 fn zzz() {()}
114 fn sentinel() {()}