]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/collapse-debuginfo-no-attr.rs
Merge commit '7d53619064ab7045c383644cb445052d2a3d46db' into sync_cg_clif-2023-02-09
[rust.git] / tests / debuginfo / collapse-debuginfo-no-attr.rs
1 // ignore-lldb
2 #![feature(collapse_debuginfo)]
3
4 // Test that line numbers are not replaced with those of the outermost expansion site when the
5 // `collapse_debuginfo` feature is active and the attribute is not provided.
6
7 // compile-flags:-g
8
9 // === GDB TESTS ===================================================================================
10
11 // gdb-command:run
12 // gdb-command:next
13 // gdb-command:frame
14 // gdb-check:[...]#loc1[...]
15 // gdb-command:next
16 // gdb-command:frame
17 // gdb-check:[...]#loc2[...]
18 // gdb-command:next
19 // gdb-command:frame
20 // gdb-check:[...]#loc3[...]
21 // gdb-command:next
22 // gdb-command:frame
23 // gdb-check:[...]#loc4[...]
24 // gdb-command:continue
25
26 fn one() {
27     println!("one");
28 }
29 fn two() {
30     println!("two");
31 }
32 fn three() {
33     println!("three");
34 }
35 fn four() {
36     println!("four");
37 }
38
39 macro_rules! outer {
40     ($b:block) => {
41         one(); // #loc1
42         inner!();
43         $b
44     };
45 }
46
47 macro_rules! inner {
48     () => {
49         two(); // #loc2
50     };
51 }
52
53 fn main() {
54     let ret = 0; // #break
55     outer!({
56         three(); // #loc3
57         four(); // #loc4
58     });
59     std::process::exit(ret);
60 }