]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/multi-cgu.rs
Merge remote-tracking branch 'miri/upstream' into miri
[rust.git] / src / test / debuginfo / multi-cgu.rs
1 // Copyright 2017 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 // This test case makes sure that we get proper break points for binaries
13 // compiled with multiple codegen units. (see #39160)
14
15
16 // min-lldb-version: 310
17
18 // compile-flags:-g -Ccodegen-units=2
19
20 // === GDB TESTS ===============================================================
21
22 // gdb-command:run
23
24 // gdb-command:print xxx
25 // gdb-check:$1 = 12345
26 // gdb-command:continue
27
28 // gdb-command:print yyy
29 // gdb-check:$2 = 67890
30 // gdb-command:continue
31
32
33 // === LLDB TESTS ==============================================================
34
35 // lldb-command:run
36
37 // lldb-command:print xxx
38 // lldb-check:[...]$0 = 12345
39 // lldb-command:continue
40
41 // lldb-command:print yyy
42 // lldb-check:[...]$1 = 67890
43 // lldb-command:continue
44
45
46 #![feature(omit_gdb_pretty_printer_section)]
47 #![omit_gdb_pretty_printer_section]
48
49 mod a {
50     pub fn foo(xxx: u32) {
51         super::_zzz(); // #break
52     }
53 }
54
55 mod b {
56     pub fn bar(yyy: u64) {
57         super::_zzz(); // #break
58     }
59 }
60
61 fn main() {
62     a::foo(12345);
63     b::bar(67890);
64 }
65
66 #[inline(never)]
67 fn _zzz() {}