]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/shadowed-argument.rs
Rollup merge of #107446 - clubby789:rustc-parse-diag-migrate, r=compiler-errors
[rust.git] / tests / debuginfo / shadowed-argument.rs
1 // min-lldb-version: 310
2
3 // compile-flags:-g
4
5 // === GDB TESTS ===================================================================================
6
7 // gdb-command:run
8
9 // gdb-command:print x
10 // gdb-check:$1 = false
11 // gdb-command:print y
12 // gdb-check:$2 = true
13 // gdb-command:continue
14
15 // gdb-command:print x
16 // gdb-check:$3 = 10
17 // gdb-command:print y
18 // gdb-check:$4 = true
19 // gdb-command:continue
20
21 // gdb-command:print x
22 // gdb-check:$5 = 10.5
23 // gdb-command:print y
24 // gdb-check:$6 = 20
25 // gdb-command:continue
26
27
28 // === LLDB TESTS ==================================================================================
29
30 // lldb-command:run
31
32 // lldb-command:print x
33 // lldbg-check:[...]$0 = false
34 // lldbr-check:(bool) x = false
35 // lldb-command:print y
36 // lldbg-check:[...]$1 = true
37 // lldbr-check:(bool) y = true
38 // lldb-command:continue
39
40 // lldb-command:print x
41 // lldbg-check:[...]$2 = 10
42 // lldbr-check:(i32) x = 10
43 // lldb-command:print y
44 // lldbg-check:[...]$3 = true
45 // lldbr-check:(bool) y = true
46 // lldb-command:continue
47
48 // lldb-command:print x
49 // lldbg-check:[...]$4 = 10.5
50 // lldbr-check:(f64) x = 10.5
51 // lldb-command:print y
52 // lldbg-check:[...]$5 = 20
53 // lldbr-check:(i32) y = 20
54 // lldb-command:continue
55
56
57 #![feature(omit_gdb_pretty_printer_section)]
58 #![omit_gdb_pretty_printer_section]
59
60 fn a_function(x: bool, y: bool) {
61     zzz(); // #break
62     sentinel();
63
64     let x = 10;
65
66     zzz(); // #break
67     sentinel();
68
69     let x = 10.5f64;
70     let y = 20;
71
72     zzz(); // #break
73     sentinel();
74 }
75
76 fn main() {
77     a_function(false, true);
78 }
79
80 fn zzz() {()}
81 fn sentinel() {()}