]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/limited-debuginfo.rs
rollup merge of #20642: michaelwoerister/sane-source-locations-pt1
[rust.git] / src / test / debuginfo / limited-debuginfo.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
13 // ignore-lldb
14
15 // compile-flags:-C debuginfo=1
16
17 // Make sure functions have proper names
18 // gdb-command:info functions
19 // gdb-check:[...]void[...]main([...]);
20 // gdb-check:[...]void[...]some_function([...]);
21 // gdb-check:[...]void[...]some_other_function([...]);
22 // gdb-check:[...]void[...]zzz([...]);
23
24 // gdb-command:run
25
26 // Make sure there is no information about locals
27 // gdb-command:info locals
28 // gdb-check:No locals.
29 // gdb-command:continue
30
31
32 #![allow(unused_variables)]
33 #![omit_gdb_pretty_printer_section]
34
35 struct Struct {
36     a: i64,
37     b: i32
38 }
39
40 fn main() {
41     some_function(101, 202);
42     some_other_function(1, 2);
43 }
44
45
46 fn zzz() {()}
47
48 fn some_function(a: int, b: int) {
49     let some_variable = Struct { a: 11, b: 22 };
50     let some_other_variable = 23i;
51
52     for x in range(0, 1) {
53         zzz(); // #break
54     }
55 }
56
57 fn some_other_function(a: int, b: int) -> bool { true }
58