]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/lexical-scope-in-unique-closure.rs
Rollup merge of #107819 - clubby789:x-py-root, r=jyn514
[rust.git] / tests / debuginfo / lexical-scope-in-unique-closure.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:continue
12
13 // gdb-command:print x
14 // gdb-check:$2 = false
15 // gdb-command:continue
16
17 // gdb-command:print x
18 // gdb-check:$3 = 1000
19 // gdb-command:continue
20
21 // gdb-command:print x
22 // gdb-check:$4 = 2.5
23 // gdb-command:continue
24
25 // gdb-command:print x
26 // gdb-check:$5 = true
27 // gdb-command:continue
28
29 // gdb-command:print x
30 // gdb-check:$6 = false
31 // gdb-command:continue
32
33
34 // === LLDB TESTS ==================================================================================
35
36 // lldb-command:run
37
38 // lldb-command:print x
39 // lldbg-check:[...]$0 = false
40 // lldbr-check:(bool) x = false
41 // lldb-command:continue
42
43 // lldb-command:print x
44 // lldbg-check:[...]$1 = false
45 // lldbr-check:(bool) x = false
46 // lldb-command:continue
47
48 // lldb-command:print x
49 // lldbg-check:[...]$2 = 1000
50 // lldbr-check:(isize) x = 1000
51 // lldb-command:continue
52
53 // lldb-command:print x
54 // lldbg-check:[...]$3 = 2.5
55 // lldbr-check:(f64) x = 2.5
56 // lldb-command:continue
57
58 // lldb-command:print x
59 // lldbg-check:[...]$4 = true
60 // lldbr-check:(bool) x = true
61 // lldb-command:continue
62
63 // lldb-command:print x
64 // lldbg-check:[...]$5 = false
65 // lldbr-check:(bool) x = false
66 // lldb-command:continue
67
68
69 #![feature(omit_gdb_pretty_printer_section)]
70 #![omit_gdb_pretty_printer_section]
71
72 fn main() {
73
74     let x = false;
75
76     zzz(); // #break
77     sentinel();
78
79     let unique_closure = |x:isize| {
80         zzz(); // #break
81         sentinel();
82
83         let x = 2.5f64;
84
85         zzz(); // #break
86         sentinel();
87
88         let x = true;
89
90         zzz(); // #break
91         sentinel();
92     };
93
94     zzz(); // #break
95     sentinel();
96
97     unique_closure(1000);
98
99     zzz(); // #break
100     sentinel();
101 }
102
103 fn zzz() {()}
104 fn sentinel() {()}