1 // ignore-tidy-linelength
2 // ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
3 // min-lldb-version: 310
5 // This test case checks if function arguments already have the correct value
6 // when breaking at the first line of the function, that is if the function
7 // prologue has already been executed at the first line. Note that because of
8 // the __morestack part of the prologue GDB incorrectly breaks at before the
9 // arguments have been properly loaded when setting the breakpoint via the
14 // === GDB TESTS ===================================================================================
19 // gdb-command:print a
21 // gdb-command:print b
22 // gdb-check:$2 = true
23 // gdb-command:print c
25 // gdb-command:continue
28 // gdb-command:print a
29 // gdbg-check:$4 = {a = 3, b = 4, c = 5, d = 6, e = 7, f = 8, g = 9, h = 10}
30 // gdbt-check:$4 = function_arg_initialization::BigStruct {a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10}
31 // gdb-command:print b
32 // gdbg-check:$5 = {a = 11, b = 12, c = 13, d = 14, e = 15, f = 16, g = 17, h = 18}
33 // gdbt-check:$5 = function_arg_initialization::BigStruct {a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18}
34 // gdb-command:continue
37 // gdb-command:print a
39 // gdb-command:print b
41 // gdb-command:print c
42 // gdb-check:$8 = 21.5
43 // gdb-command:continue
46 // gdb-command:print a
48 // gdb-command:print b
50 // gdb-command:print c
51 // gdb-check:$11 = 24.5
52 // gdb-command:continue
55 // gdb-command:print x
57 // gdb-command:print y
59 // gdb-command:print z
60 // gdb-check:$14 = 27.5
61 // gdb-command:continue
64 // gdb-command:print x
66 // gdb-command:print y
68 // gdb-command:print z
69 // gdb-check:$17 = 30.5
70 // gdb-command:continue
73 // gdb-command:print x
75 // gdb-command:print y
77 // gdb-command:print z
78 // gdb-check:$20 = 33.5
79 // gdb-command:continue
82 // gdb-command:print x
84 // gdb-command:print y
86 // gdb-command:print z
87 // gdb-check:$23 = 36.5
88 // gdb-command:continue
91 // gdb-command:print x
93 // gdb-command:print y
95 // gdb-command:print z
96 // gdb-check:$26 = 39.5
97 // gdb-command:continue
100 // gdb-command:print x
101 // gdb-check:$27 = 40
102 // gdb-command:print y
103 // gdb-check:$28 = 41
104 // gdb-command:print z
105 // gdb-check:$29 = 42
106 // gdb-command:continue
109 // gdb-command:print x
110 // gdb-check:$30 = 43
111 // gdb-command:print y
112 // gdb-check:$31 = 44
113 // gdb-command:print z
114 // gdb-check:$32 = 45
115 // gdb-command:continue
118 // === LLDB TESTS ==================================================================================
123 // lldb-command:print a
124 // lldb-check:[...]$0 = 1
125 // lldb-command:print b
126 // lldb-check:[...]$1 = true
127 // lldb-command:print c
128 // lldb-check:[...]$2 = 2.5
129 // lldb-command:continue
131 // NON IMMEDIATE ARGS
132 // lldb-command:print a
133 // lldb-check:[...]$3 = BigStruct { a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10 }
134 // lldb-command:print b
135 // lldb-check:[...]$4 = BigStruct { a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18 }
136 // lldb-command:continue
139 // lldb-command:print a
140 // lldb-check:[...]$5 = 19
141 // lldb-command:print b
142 // lldb-check:[...]$6 = 20
143 // lldb-command:print c
144 // lldb-check:[...]$7 = 21.5
145 // lldb-command:continue
148 // lldb-command:print a
149 // lldb-check:[...]$8 = 22
150 // lldb-command:print b
151 // lldb-check:[...]$9 = 23
152 // lldb-command:print c
153 // lldb-check:[...]$10 = 24.5
154 // lldb-command:continue
157 // lldb-command:print x
158 // lldb-check:[...]$11 = 25
159 // lldb-command:print y
160 // lldb-check:[...]$12 = 26
161 // lldb-command:print z
162 // lldb-check:[...]$13 = 27.5
163 // lldb-command:continue
166 // lldb-command:print x
167 // lldb-check:[...]$14 = 28
168 // lldb-command:print y
169 // lldb-check:[...]$15 = 29
170 // lldb-command:print z
171 // lldb-check:[...]$16 = 30.5
172 // lldb-command:continue
175 // lldb-command:print x
176 // lldb-check:[...]$17 = 31
177 // lldb-command:print y
178 // lldb-check:[...]$18 = 32
179 // lldb-command:print z
180 // lldb-check:[...]$19 = 33.5
181 // lldb-command:continue
184 // lldb-command:print x
185 // lldb-check:[...]$20 = 34
186 // lldb-command:print y
187 // lldb-check:[...]$21 = 35
188 // lldb-command:print z
189 // lldb-check:[...]$22 = 36.5
190 // lldb-command:continue
193 // lldb-command:print x
194 // lldb-check:[...]$23 = 37
195 // lldb-command:print y
196 // lldb-check:[...]$24 = 38
197 // lldb-command:print z
198 // lldb-check:[...]$25 = 39.5
199 // lldb-command:continue
202 // lldb-command:print x
203 // lldb-check:[...]$26 = 40
204 // lldb-command:print y
205 // lldb-check:[...]$27 = 41
206 // lldb-command:print z
207 // lldb-check:[...]$28 = 42
208 // lldb-command:continue
211 // lldb-command:print x
212 // lldb-check:[...]$29 = 43
213 // lldb-command:print y
214 // lldb-check:[...]$30 = 44
215 // lldb-command:print z
216 // lldb-check:[...]$31 = 45
217 // lldb-command:continue
220 #![allow(unused_variables)]
221 #![feature(omit_gdb_pretty_printer_section)]
222 #![omit_gdb_pretty_printer_section]
224 fn immediate_args(a: isize, b: bool, c: f64) {
239 fn non_immediate_args(a: BigStruct, b: BigStruct) {
243 fn binding(a: i64, b: u64, c: f64) {
248 fn assignment(mut a: u64, b: u64, c: f64) {
253 fn function_call(x: u64, y: u64, z: f64) {
257 fn identifier(x: u64, y: u64, z: f64) -> u64 {
261 fn return_expr(x: u64, y: u64, z: f64) -> u64 {
265 fn arithmetic_expr(x: u64, y: u64, z: f64) -> u64 {
269 fn if_expr(x: u64, y: u64, z: f64) -> u64 {
270 if x + y < 1000 { // #break
277 fn while_expr(mut x: u64, y: u64, z: u64) -> u64 {
278 while x + y > 1000 { // #break
284 fn loop_expr(mut x: u64, y: u64, z: u64) -> u64 {
295 immediate_args(1, true, 2.5);
320 binding(19, 20, 21.5);
321 assignment(22, 23, 24.5);
322 function_call(25, 26, 27.5);
323 identifier(28, 29, 30.5);
324 return_expr(31, 32, 33.5);
325 arithmetic_expr(34, 35, 36.5);
326 if_expr(37, 38, 39.5);
327 while_expr(40, 41, 42);
328 loop_expr(43, 44, 45);