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