]> git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/limited-debuginfo.rs
New upstream version 1.25.0+dfsg1
[rustc.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
12 // ignore-lldb
13 // ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
14
15 // compile-flags:-C debuginfo=1
16
17 // Make sure functions have proper names
18 // gdb-command:info functions
19 // gdbg-check:[...]void[...]main([...]);
20 // gdbr-check:fn limited_debuginfo::main();
21 // gdbg-check:[...]void[...]some_function([...]);
22 // gdbr-check:fn limited_debuginfo::some_function();
23 // gdbg-check:[...]void[...]some_other_function([...]);
24 // gdbr-check:fn limited_debuginfo::some_other_function();
25 // gdbg-check:[...]void[...]zzz([...]);
26 // gdbr-check:fn limited_debuginfo::zzz();
27
28 // gdb-command:run
29
30 // Make sure there is no information about locals
31 // gdb-command:info locals
32 // gdb-check:No locals.
33 // gdb-command:continue
34
35
36 #![allow(unused_variables)]
37 #![feature(omit_gdb_pretty_printer_section)]
38 #![omit_gdb_pretty_printer_section]
39
40 struct Struct {
41 a: i64,
42 b: i32
43 }
44
45 fn main() {
46 some_function(101, 202);
47 some_other_function(1, 2);
48 }
49
50
51 fn zzz() {()}
52
53 fn some_function(a: isize, b: isize) {
54 let some_variable = Struct { a: 11, b: 22 };
55 let some_other_variable = 23;
56
57 for x in 0..1 {
58 zzz(); // #break
59 }
60 }
61
62 fn some_other_function(a: isize, b: isize) -> bool { true }