]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/lexical-scope-in-stack-closure.rs
Rollup merge of #107819 - clubby789:x-py-root, r=jyn514
[rust.git] / tests / debuginfo / lexical-scope-in-stack-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 #![feature(omit_gdb_pretty_printer_section)]
69 #![omit_gdb_pretty_printer_section]
70
71 fn main() {
72
73     let x = false;
74
75     zzz(); // #break
76     sentinel();
77
78     let closure = |x: isize| {
79         zzz(); // #break
80         sentinel();
81
82         let x = 2.5f64;
83
84         zzz(); // #break
85         sentinel();
86
87         let x = true;
88
89         zzz(); // #break
90         sentinel();
91     };
92
93     zzz(); // #break
94     sentinel();
95
96     closure(1000);
97
98     zzz(); // #break
99     sentinel();
100 }
101
102 fn zzz() {()}
103 fn sentinel() {()}