]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/collapse-debuginfo-with-attr-flag.rs
Rollup merge of #107580 - lenko-d:default_value_for_a_lifetime_generic_parameter_prod...
[rust.git] / tests / debuginfo / collapse-debuginfo-with-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 and `-Zdebug-macros` is provided, despite `#[collapse_debuginfo]`
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 #[collapse_debuginfo]
41 macro_rules! outer {
42     ($b:block) => {
43         one(); // #loc1
44         inner!();
45         $b
46     };
47 }
48
49 #[collapse_debuginfo]
50 macro_rules! inner {
51     () => {
52         two(); // #loc2
53     };
54 }
55
56 fn main() {
57     let ret = 0; // #break
58     outer!({
59         three(); // #loc3
60         four(); // #loc4
61     });
62     std::process::exit(ret);
63 }