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