1 // ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
2 // min-lldb-version: 310
4 // This test case checks if function arguments already have the correct value
5 // when breaking at the first line of the function, that is if the function
6 // prologue has already been executed at the first line. Note that because of
7 // the __morestack part of the prologue GDB incorrectly breaks at before the
8 // arguments have been properly loaded when setting the breakpoint via the
13 // === GDB TESTS ===================================================================================
18 // gdb-command:print a
20 // gdb-command:print b
21 // gdb-check:$2 = true
22 // gdb-command:print c
24 // gdb-command:continue
27 // gdb-command:print a
28 // gdbg-check:$4 = {a = 3, b = 4, c = 5, d = 6, e = 7, f = 8, g = 9, h = 10}
29 // gdbt-check:$4 = function_arg_initialization::BigStruct {a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10}
30 // gdb-command:print b
31 // gdbg-check:$5 = {a = 11, b = 12, c = 13, d = 14, e = 15, f = 16, g = 17, h = 18}
32 // gdbt-check:$5 = function_arg_initialization::BigStruct {a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18}
33 // gdb-command:continue
36 // gdb-command:print a
38 // gdb-command:print b
40 // gdb-command:print c
41 // gdb-check:$8 = 21.5
42 // gdb-command:continue
45 // gdb-command:print a
47 // gdb-command:print b
49 // gdb-command:print c
50 // gdb-check:$11 = 24.5
51 // gdb-command:continue
54 // gdb-command:print x
56 // gdb-command:print y
58 // gdb-command:print z
59 // gdb-check:$14 = 27.5
60 // gdb-command:continue
63 // gdb-command:print x
65 // gdb-command:print y
67 // gdb-command:print z
68 // gdb-check:$17 = 30.5
69 // gdb-command:continue
72 // gdb-command:print x
74 // gdb-command:print y
76 // gdb-command:print z
77 // gdb-check:$20 = 33.5
78 // gdb-command:continue
81 // gdb-command:print x
83 // gdb-command:print y
85 // gdb-command:print z
86 // gdb-check:$23 = 36.5
87 // gdb-command:continue
90 // gdb-command:print x
92 // gdb-command:print y
94 // gdb-command:print z
95 // gdb-check:$26 = 39.5
96 // gdb-command:continue
99 // gdb-command:print x
100 // gdb-check:$27 = 40
101 // gdb-command:print y
102 // gdb-check:$28 = 41
103 // gdb-command:print z
104 // gdb-check:$29 = 42
105 // gdb-command:continue
108 // gdb-command:print x
109 // gdb-check:$30 = 43
110 // gdb-command:print y
111 // gdb-check:$31 = 44
112 // gdb-command:print z
113 // gdb-check:$32 = 45
114 // gdb-command:continue
117 // === LLDB TESTS ==================================================================================
122 // lldb-command:print a
123 // lldb-check:[...]$0 = 1
124 // lldb-command:print b
125 // lldb-check:[...]$1 = true
126 // lldb-command:print c
127 // lldb-check:[...]$2 = 2.5
128 // lldb-command:continue
130 // NON IMMEDIATE ARGS
131 // lldb-command:print a
132 // lldb-check:[...]$3 = BigStruct { a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10 }
133 // lldb-command:print b
134 // lldb-check:[...]$4 = BigStruct { a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18 }
135 // lldb-command:continue
138 // lldb-command:print a
139 // lldb-check:[...]$5 = 19
140 // lldb-command:print b
141 // lldb-check:[...]$6 = 20
142 // lldb-command:print c
143 // lldb-check:[...]$7 = 21.5
144 // lldb-command:continue
147 // lldb-command:print a
148 // lldb-check:[...]$8 = 22
149 // lldb-command:print b
150 // lldb-check:[...]$9 = 23
151 // lldb-command:print c
152 // lldb-check:[...]$10 = 24.5
153 // lldb-command:continue
156 // lldb-command:print x
157 // lldb-check:[...]$11 = 25
158 // lldb-command:print y
159 // lldb-check:[...]$12 = 26
160 // lldb-command:print z
161 // lldb-check:[...]$13 = 27.5
162 // lldb-command:continue
165 // lldb-command:print x
166 // lldb-check:[...]$14 = 28
167 // lldb-command:print y
168 // lldb-check:[...]$15 = 29
169 // lldb-command:print z
170 // lldb-check:[...]$16 = 30.5
171 // lldb-command:continue
174 // lldb-command:print x
175 // lldb-check:[...]$17 = 31
176 // lldb-command:print y
177 // lldb-check:[...]$18 = 32
178 // lldb-command:print z
179 // lldb-check:[...]$19 = 33.5
180 // lldb-command:continue
183 // lldb-command:print x
184 // lldb-check:[...]$20 = 34
185 // lldb-command:print y
186 // lldb-check:[...]$21 = 35
187 // lldb-command:print z
188 // lldb-check:[...]$22 = 36.5
189 // lldb-command:continue
192 // lldb-command:print x
193 // lldb-check:[...]$23 = 37
194 // lldb-command:print y
195 // lldb-check:[...]$24 = 38
196 // lldb-command:print z
197 // lldb-check:[...]$25 = 39.5
198 // lldb-command:continue
201 // lldb-command:print x
202 // lldb-check:[...]$26 = 40
203 // lldb-command:print y
204 // lldb-check:[...]$27 = 41
205 // lldb-command:print z
206 // lldb-check:[...]$28 = 42
207 // lldb-command:continue
210 // lldb-command:print x
211 // lldb-check:[...]$29 = 43
212 // lldb-command:print y
213 // lldb-check:[...]$30 = 44
214 // lldb-command:print z
215 // lldb-check:[...]$31 = 45
216 // lldb-command:continue
219 #![allow(unused_variables)]
220 #![feature(omit_gdb_pretty_printer_section)]
221 #![omit_gdb_pretty_printer_section]
223 fn immediate_args(a: isize, b: bool, c: f64) {
238 fn non_immediate_args(a: BigStruct, b: BigStruct) {
242 fn binding(a: i64, b: u64, c: f64) {
247 fn assignment(mut a: u64, b: u64, c: f64) {
252 fn function_call(x: u64, y: u64, z: f64) {
256 fn identifier(x: u64, y: u64, z: f64) -> u64 {
260 fn return_expr(x: u64, y: u64, z: f64) -> u64 {
264 fn arithmetic_expr(x: u64, y: u64, z: f64) -> u64 {
268 fn if_expr(x: u64, y: u64, z: f64) -> u64 {
269 if x + y < 1000 { // #break
276 fn while_expr(mut x: u64, y: u64, z: u64) -> u64 {
277 while x + y > 1000 { // #break
283 fn loop_expr(mut x: u64, y: u64, z: u64) -> u64 {
294 immediate_args(1, true, 2.5);
319 binding(19, 20, 21.5);
320 assignment(22, 23, 24.5);
321 function_call(25, 26, 27.5);
322 identifier(28, 29, 30.5);
323 return_expr(31, 32, 33.5);
324 arithmetic_expr(34, 35, 36.5);
325 if_expr(37, 38, 39.5);
326 while_expr(40, 41, 42);
327 loop_expr(43, 44, 45);