]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/macro-stepping.rs
Rollup merge of #107700 - jyn514:tools-builder, r=Mark-Simulacrum
[rust.git] / tests / debuginfo / macro-stepping.rs
1 // ignore-windows
2 // ignore-android
3 // ignore-aarch64
4 // min-lldb-version: 310
5 // ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
6
7 // aux-build:macro-stepping.rs
8
9 #![allow(unused)]
10
11 #[macro_use]
12 extern crate macro_stepping; // exports new_scope!()
13
14 // compile-flags:-g
15
16 // === GDB TESTS ===================================================================================
17
18 // gdb-command:run
19 // gdb-command:next
20 // gdb-command:frame
21 // gdb-check:[...]#loc1[...]
22 // gdb-command:next
23 // gdb-command:frame
24 // gdb-check:[...]#loc2[...]
25 // gdb-command:next
26 // gdb-command:frame
27 // gdb-check:[...]#loc3[...]
28 // gdb-command:next
29 // gdb-command:frame
30 // gdb-check:[...]#loc4[...]
31 // gdb-command:next
32 // gdb-command:frame
33 // gdb-check:[...]#loc5[...]
34 // gdb-command:next
35 // gdb-command:frame
36 // gdb-check:[...]#loc6[...]
37
38 // gdb-command:continue
39 // gdb-command:step
40 // gdb-command:frame
41 // gdb-check:[...]#inc-loc1[...]
42 // gdb-command:next
43 // gdb-command:frame
44 // gdb-check:[...]#inc-loc2[...]
45 // gdb-command:next
46 // gdb-command:frame
47 // gdb-check:[...]#inc-loc3[...]
48
49 // === LLDB TESTS ==================================================================================
50
51 // lldb-command:set set stop-line-count-before 0
52 // lldb-command:set set stop-line-count-after 1
53 // Can't set both to zero or lldb will stop printing source at all.  So it will output the current
54 // line and the next.  We deal with this by having at least 2 lines between the #loc's
55
56 // lldb-command:run
57 // lldb-command:next
58 // lldb-command:frame select
59 // lldb-check:[...]#loc1[...]
60 // lldb-command:next
61 // lldb-command:frame select
62 // lldb-check:[...]#loc2[...]
63 // lldb-command:next
64 // lldb-command:frame select
65 // lldb-check:[...]#loc3[...]
66 // lldb-command:next
67 // lldb-command:frame select
68 // lldb-check:[...]#loc4[...]
69 // lldb-command:next
70 // lldb-command:frame select
71 // lldb-check:[...]#loc5[...]
72
73 // lldb-command:continue
74 // lldb-command:step
75 // lldb-command:frame select
76 // lldb-check:[...]#inc-loc1[...]
77 // lldb-command:next
78 // lldb-command:frame select
79 // lldb-check:[...]#inc-loc2[...]
80 // lldb-command:next
81 // lldb-command:frame select
82 // lldb-check:[...]#inc-loc3[...]
83
84 macro_rules! foo {
85     () => {
86         let a = 1;
87         let b = 2;
88         let c = 3;
89     }
90 }
91
92 macro_rules! foo2 {
93     () => {
94         foo!();
95         let x = 1;
96         foo!();
97     }
98 }
99
100 fn main() {
101     zzz(); // #break
102
103     foo!(); // #loc1
104
105     foo2!(); // #loc2
106
107     let x = vec![42]; // #loc3
108
109     new_scope!(); // #loc4
110
111     println!("Hello {}", // #loc5
112              "world");
113
114     zzz(); // #loc6
115
116     included(); // #break
117 }
118
119 fn zzz() {()}
120
121 include!("macro-stepping.inc");