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