]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/multi-cgu.rs
Rollup merge of #54816 - oli-obk:double_promotion, r=alexreg
[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 // lldbg-check:[...]$0 = 12345
39 // lldbr-check:(u32) xxx = 12345
40 // lldb-command:continue
41
42 // lldb-command:print yyy
43 // lldbg-check:[...]$1 = 67890
44 // lldbr-check:(u64) yyy = 67890
45 // lldb-command:continue
46
47
48 #![feature(omit_gdb_pretty_printer_section)]
49 #![omit_gdb_pretty_printer_section]
50
51 mod a {
52     pub fn foo(xxx: u32) {
53         super::_zzz(); // #break
54     }
55 }
56
57 mod b {
58     pub fn bar(yyy: u64) {
59         super::_zzz(); // #break
60     }
61 }
62
63 fn main() {
64     a::foo(12345);
65     b::bar(67890);
66 }
67
68 #[inline(never)]
69 fn _zzz() {}