]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/lexical-scope-in-for-loop.rs
Add verbose option to rustdoc in order to fix problem with --version
[rust.git] / src / test / debuginfo / lexical-scope-in-for-loop.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 // FIRST ITERATION
21 // gdb-command:print x
22 // gdb-check:$1 = 1
23 // gdb-command:continue
24
25 // gdb-command:print x
26 // gdb-check:$2 = -1
27 // gdb-command:continue
28
29 // SECOND ITERATION
30 // gdb-command:print x
31 // gdb-check:$3 = 2
32 // gdb-command:continue
33
34 // gdb-command:print x
35 // gdb-check:$4 = -2
36 // gdb-command:continue
37
38 // THIRD ITERATION
39 // gdb-command:print x
40 // gdb-check:$5 = 3
41 // gdb-command:continue
42
43 // gdb-command:print x
44 // gdb-check:$6 = -3
45 // gdb-command:continue
46
47 // AFTER LOOP
48 // gdb-command:print x
49 // gdb-check:$7 = 1000000
50 // gdb-command:continue
51
52
53 // === LLDB TESTS ==================================================================================
54
55 // lldb-command:run
56
57 // FIRST ITERATION
58 // lldb-command:print x
59 // lldb-check:[...]$0 = 1
60 // lldb-command:continue
61
62 // lldb-command:print x
63 // lldb-check:[...]$1 = -1
64 // lldb-command:continue
65
66 // SECOND ITERATION
67 // lldb-command:print x
68 // lldb-check:[...]$2 = 2
69 // lldb-command:continue
70
71 // lldb-command:print x
72 // lldb-check:[...]$3 = -2
73 // lldb-command:continue
74
75 // THIRD ITERATION
76 // lldb-command:print x
77 // lldb-check:[...]$4 = 3
78 // lldb-command:continue
79
80 // lldb-command:print x
81 // lldb-check:[...]$5 = -3
82 // lldb-command:continue
83
84 // AFTER LOOP
85 // lldb-command:print x
86 // lldb-check:[...]$6 = 1000000
87 // lldb-command:continue
88
89 fn main() {
90
91     let range = [1i, 2, 3];
92
93     let x = 1000000i; // wan meeeljen doollaars!
94
95     for &x in range.iter() {
96         zzz(); // #break
97         sentinel();
98
99         let x = -1i * x;
100
101         zzz(); // #break
102         sentinel();
103     }
104
105     zzz(); // #break
106     sentinel();
107 }
108
109 fn zzz() {()}
110 fn sentinel() {()}