blob: 8da084126ca06697654f65ada42ffa41fc2c3266 [file] [log] [blame]
许杰友 Jieyou Xu (Joe)6e48b962024-02-22 12:10:291//@ ignore-lldb
David Wood38958aa2022-07-21 15:19:222
Vadim Petrochenkov98804c12024-02-09 12:39:253// 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 Wood38958aa2022-07-21 15:19:225
Vadim Petrochenkov98804c12024-02-09 12:39:256//@ compile-flags:-g -C collapse-macro-debuginfo=false
David Wood38958aa2022-07-21 15:19:227
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
25fn one() {
26 println!("one");
27}
28fn two() {
29 println!("two");
30}
31fn three() {
32 println!("three");
33}
34fn four() {
35 println!("four");
36}
37
Vadim Petrochenkov98804c12024-02-09 12:39:2538#[collapse_debuginfo(yes)]
David Wood38958aa2022-07-21 15:19:2239macro_rules! outer {
40 ($b:block) => {
41 one(); // #loc1
42 inner!();
43 $b
44 };
45}
46
Vadim Petrochenkov98804c12024-02-09 12:39:2547#[collapse_debuginfo(yes)]
David Wood38958aa2022-07-21 15:19:2248macro_rules! inner {
49 () => {
50 two(); // #loc2
51 };
52}
53
54fn main() {
55 let ret = 0; // #break
56 outer!({
57 three(); // #loc3
58 four(); // #loc4
59 });
60 std::process::exit(ret);
61}