]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/lexical-scope-in-unique-closure.rs
Auto merge of #54626 - alexcrichton:dwarf-generics, r=michaelwoerister
[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 // lldbg-check:[...]$0 = false
50 // lldbr-check:(bool) x = false
51 // lldb-command:continue
52
53 // lldb-command:print x
54 // lldbg-check:[...]$1 = false
55 // lldbr-check:(bool) x = false
56 // lldb-command:continue
57
58 // lldb-command:print x
59 // lldbg-check:[...]$2 = 1000
60 // lldbr-check:(isize) x = 1000
61 // lldb-command:continue
62
63 // lldb-command:print x
64 // lldbg-check:[...]$3 = 2.5
65 // lldbr-check:(f64) x = 2.5
66 // lldb-command:continue
67
68 // lldb-command:print x
69 // lldbg-check:[...]$4 = true
70 // lldbr-check:(bool) x = true
71 // lldb-command:continue
72
73 // lldb-command:print x
74 // lldbg-check:[...]$5 = false
75 // lldbr-check:(bool) x = false
76 // lldb-command:continue
77
78
79 #![feature(omit_gdb_pretty_printer_section)]
80 #![omit_gdb_pretty_printer_section]
81
82 fn main() {
83
84     let x = false;
85
86     zzz(); // #break
87     sentinel();
88
89     let unique_closure = |x:isize| {
90         zzz(); // #break
91         sentinel();
92
93         let x = 2.5f64;
94
95         zzz(); // #break
96         sentinel();
97
98         let x = true;
99
100         zzz(); // #break
101         sentinel();
102     };
103
104     zzz(); // #break
105     sentinel();
106
107     unique_closure(1000);
108
109     zzz(); // #break
110     sentinel();
111 }
112
113 fn zzz() {()}
114 fn sentinel() {()}