许杰友 Jieyou Xu (Joe) | 6e48b96 | 2024-02-22 12:10:29 | [diff] [blame] | 1 | //@ ignore-lldb |
David Wood | 38958aa | 2022-07-21 15:19:22 | [diff] [blame] | 2 | |
Vadim Petrochenkov | 98804c1 | 2024-02-09 12:39:25 | [diff] [blame] | 3 | // Test that line numbers are not replaced with those of the outermost expansion site when |
| 4 | // `-C collapse-macro-debuginfo=false` is passed, despite `#[collapse_debuginfo]` being used. |
David Wood | 38958aa | 2022-07-21 15:19:22 | [diff] [blame] | 5 | |
Vadim Petrochenkov | 98804c1 | 2024-02-09 12:39:25 | [diff] [blame] | 6 | //@ compile-flags:-g -C collapse-macro-debuginfo=false |
David Wood | 38958aa | 2022-07-21 15:19:22 | [diff] [blame] | 7 | |
| 8 | // === GDB TESTS =================================================================================== |
| 9 | |
| 10 | // gdb-command:run |
| 11 | // gdb-command:next |
| 12 | // gdb-command:frame |
| 13 | // gdb-check:[...]#loc1[...] |
| 14 | // gdb-command:next |
| 15 | // gdb-command:frame |
| 16 | // gdb-check:[...]#loc2[...] |
| 17 | // gdb-command:next |
| 18 | // gdb-command:frame |
| 19 | // gdb-check:[...]#loc3[...] |
| 20 | // gdb-command:next |
| 21 | // gdb-command:frame |
| 22 | // gdb-check:[...]#loc4[...] |
| 23 | // gdb-command:continue |
| 24 | |
| 25 | fn one() { |
| 26 | println!("one"); |
| 27 | } |
| 28 | fn two() { |
| 29 | println!("two"); |
| 30 | } |
| 31 | fn three() { |
| 32 | println!("three"); |
| 33 | } |
| 34 | fn four() { |
| 35 | println!("four"); |
| 36 | } |
| 37 | |
Vadim Petrochenkov | 98804c1 | 2024-02-09 12:39:25 | [diff] [blame] | 38 | #[collapse_debuginfo(yes)] |
David Wood | 38958aa | 2022-07-21 15:19:22 | [diff] [blame] | 39 | macro_rules! outer { |
| 40 | ($b:block) => { |
| 41 | one(); // #loc1 |
| 42 | inner!(); |
| 43 | $b |
| 44 | }; |
| 45 | } |
| 46 | |
Vadim Petrochenkov | 98804c1 | 2024-02-09 12:39:25 | [diff] [blame] | 47 | #[collapse_debuginfo(yes)] |
David Wood | 38958aa | 2022-07-21 15:19:22 | [diff] [blame] | 48 | macro_rules! inner { |
| 49 | () => { |
| 50 | two(); // #loc2 |
| 51 | }; |
| 52 | } |
| 53 | |
| 54 | fn main() { |
| 55 | let ret = 0; // #break |
| 56 | outer!({ |
| 57 | three(); // #loc3 |
| 58 | four(); // #loc4 |
| 59 | }); |
| 60 | std::process::exit(ret); |
| 61 | } |