]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/cross-crate-spans.rs
Rollup merge of #107446 - clubby789:rustc-parse-diag-migrate, r=compiler-errors
[rust.git] / tests / debuginfo / cross-crate-spans.rs
1 #![feature(omit_gdb_pretty_printer_section)]
2 #![omit_gdb_pretty_printer_section]
3
4 // min-lldb-version: 310
5
6 // This fails on lldb 6.0.1 on x86-64 Fedora 28; so mark it macOS-only
7 // for now.
8 // only-macos
9
10 // aux-build:cross_crate_spans.rs
11 extern crate cross_crate_spans;
12
13 // compile-flags:-g
14
15
16 // === GDB TESTS ===================================================================================
17
18 // gdb-command:break cross_crate_spans.rs:14
19 // gdb-command:run
20
21 // gdb-command:print result
22 // gdbg-check:$1 = {__0 = 17, __1 = 17}
23 // gdbr-check:$1 = (17, 17)
24 // gdb-command:print a_variable
25 // gdb-check:$2 = 123456789
26 // gdb-command:print another_variable
27 // gdb-check:$3 = 123456789.5
28 // gdb-command:continue
29
30 // gdb-command:print result
31 // gdbg-check:$4 = {__0 = 1212, __1 = 1212}
32 // gdbr-check:$4 = (1212, 1212)
33 // gdb-command:print a_variable
34 // gdb-check:$5 = 123456789
35 // gdb-command:print another_variable
36 // gdb-check:$6 = 123456789.5
37 // gdb-command:continue
38
39
40
41 // === LLDB TESTS ==================================================================================
42
43 // lldb-command:b cross_crate_spans.rs:14
44 // lldb-command:run
45
46 // lldb-command:print result
47 // lldbg-check:[...]$0 = { 0 = 17 1 = 17 }
48 // lldbr-check:((u32, u32)) result = { 0 = 17 1 = 17 }
49 // lldb-command:print a_variable
50 // lldbg-check:[...]$1 = 123456789
51 // lldbr-check:(u32) a_variable = 123456789
52 // lldb-command:print another_variable
53 // lldbg-check:[...]$2 = 123456789.5
54 // lldbr-check:(f64) another_variable = 123456789.5
55 // lldb-command:continue
56
57 // lldb-command:print result
58 // lldbg-check:[...]$3 = { 0 = 1212 1 = 1212 }
59 // lldbr-check:((i16, i16)) result = { 0 = 1212 1 = 1212 }
60 // lldb-command:print a_variable
61 // lldbg-check:[...]$4 = 123456789
62 // lldbr-check:(u32) a_variable = 123456789
63 // lldb-command:print another_variable
64 // lldbg-check:[...]$5 = 123456789.5
65 // lldbr-check:(f64) another_variable = 123456789.5
66 // lldb-command:continue
67
68
69 // This test makes sure that we can break in functions inlined from other crates.
70
71 fn main() {
72
73     let _ = cross_crate_spans::generic_function(17u32);
74     let _ = cross_crate_spans::generic_function(1212i16);
75
76 }