]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/collapse-debuginfo-no-attr-flag.rs
Merge commit '7d53619064ab7045c383644cb445052d2a3d46db' into sync_cg_clif-2023-02-09
[rust.git] / tests / debuginfo / collapse-debuginfo-no-attr-flag.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` is active, `-Zdebug-macros` is provided and `#[collapse_debuginfo]` not
6 // being used.
7
8 // compile-flags:-g -Zdebug-macros
9
10 // === GDB TESTS ===================================================================================
11
12 // gdb-command:run
13 // gdb-command:next
14 // gdb-command:frame
15 // gdb-check:[...]#loc1[...]
16 // gdb-command:next
17 // gdb-command:frame
18 // gdb-check:[...]#loc2[...]
19 // gdb-command:next
20 // gdb-command:frame
21 // gdb-check:[...]#loc3[...]
22 // gdb-command:next
23 // gdb-command:frame
24 // gdb-check:[...]#loc4[...]
25 // gdb-command:continue
26
27 fn one() {
28     println!("one");
29 }
30 fn two() {
31     println!("two");
32 }
33 fn three() {
34     println!("three");
35 }
36 fn four() {
37     println!("four");
38 }
39
40 macro_rules! outer {
41     ($b:block) => {
42         one(); // #loc1
43         inner!();
44         $b
45     };
46 }
47
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 }