]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/collapse-debuginfo-with-attr.rs
Merge commit '7d53619064ab7045c383644cb445052d2a3d46db' into sync_cg_clif-2023-02-09
[rust.git] / tests / debuginfo / collapse-debuginfo-with-attr.rs
1 // ignore-lldb
2 #![feature(collapse_debuginfo)]
3
4 // Test that line numbers are replaced with those of the outermost expansion site when the
5 // `collapse_debuginfo` feature is active and the attribute is 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:continue
22
23 fn one() {
24     println!("one");
25 }
26 fn two() {
27     println!("two");
28 }
29 fn three() {
30     println!("three");
31 }
32 fn four() {
33     println!("four");
34 }
35
36 #[collapse_debuginfo]
37 macro_rules! outer {
38     ($b:block) => {
39         one();
40         inner!();
41         $b
42     };
43 }
44
45 #[collapse_debuginfo]
46 macro_rules! inner {
47     () => {
48         two();
49     };
50 }
51
52 fn main() {
53     let ret = 0; // #break
54     outer!({ // #loc1
55         three(); // #loc2
56         four(); // #loc3
57     });
58     std::process::exit(ret);
59 }