]> git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/lexical-scope-in-stack-closure.rs
Imported Upstream version 1.0.0~beta
[rustc.git] / src / test / debuginfo / lexical-scope-in-stack-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 #![omit_gdb_pretty_printer_section]
73
74 fn main() {
75
76 let x = false;
77
78 zzz(); // #break
79 sentinel();
80
81 let closure = |x: isize| {
82 zzz(); // #break
83 sentinel();
84
85 let x = 2.5f64;
86
87 zzz(); // #break
88 sentinel();
89
90 let x = true;
91
92 zzz(); // #break
93 sentinel();
94 };
95
96 zzz(); // #break
97 sentinel();
98
99 closure(1000);
100
101 zzz(); // #break
102 sentinel();
103 }
104
105 fn zzz() {()}
106 fn sentinel() {()}