1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // ignore-tidy-linelength
12 // ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
13 // min-lldb-version: 310
15 // This test case checks if function arguments already have the correct value
16 // when breaking at the first line of the function, that is if the function
17 // prologue has already been executed at the first line. Note that because of
18 // the __morestack part of the prologue GDB incorrectly breaks at before the
19 // arguments have been properly loaded when setting the breakpoint via the
24 // === GDB TESTS ===================================================================================
29 // gdb-command:print a
31 // gdb-command:print b
32 // gdb-check:$2 = true
33 // gdb-command:print c
35 // gdb-command:continue
38 // gdb-command:print a
39 // gdbg-check:$4 = {a = 3, b = 4, c = 5, d = 6, e = 7, f = 8, g = 9, h = 10}
40 // gdbt-check:$4 = function_arg_initialization::BigStruct {a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10}
41 // gdb-command:print b
42 // gdbg-check:$5 = {a = 11, b = 12, c = 13, d = 14, e = 15, f = 16, g = 17, h = 18}
43 // gdbt-check:$5 = function_arg_initialization::BigStruct {a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18}
44 // gdb-command:continue
47 // gdb-command:print a
49 // gdb-command:print b
51 // gdb-command:print c
52 // gdb-check:$8 = 21.5
53 // gdb-command:continue
56 // gdb-command:print a
58 // gdb-command:print b
60 // gdb-command:print c
61 // gdb-check:$11 = 24.5
62 // gdb-command:continue
65 // gdb-command:print x
67 // gdb-command:print y
69 // gdb-command:print z
70 // gdb-check:$14 = 27.5
71 // gdb-command:continue
74 // gdb-command:print x
76 // gdb-command:print y
78 // gdb-command:print z
79 // gdb-check:$17 = 30.5
80 // gdb-command:continue
83 // gdb-command:print x
85 // gdb-command:print y
87 // gdb-command:print z
88 // gdb-check:$20 = 33.5
89 // gdb-command:continue
92 // gdb-command:print x
94 // gdb-command:print y
96 // gdb-command:print z
97 // gdb-check:$23 = 36.5
98 // gdb-command:continue
101 // gdb-command:print x
102 // gdb-check:$24 = 37
103 // gdb-command:print y
104 // gdb-check:$25 = 38
105 // gdb-command:print z
106 // gdb-check:$26 = 39.5
107 // gdb-command:continue
110 // gdb-command:print x
111 // gdb-check:$27 = 40
112 // gdb-command:print y
113 // gdb-check:$28 = 41
114 // gdb-command:print z
115 // gdb-check:$29 = 42
116 // gdb-command:continue
119 // gdb-command:print x
120 // gdb-check:$30 = 43
121 // gdb-command:print y
122 // gdb-check:$31 = 44
123 // gdb-command:print z
124 // gdb-check:$32 = 45
125 // gdb-command:continue
128 // === LLDB TESTS ==================================================================================
133 // lldb-command:print a
134 // lldb-check:[...]$0 = 1
135 // lldb-command:print b
136 // lldb-check:[...]$1 = true
137 // lldb-command:print c
138 // lldb-check:[...]$2 = 2.5
139 // lldb-command:continue
141 // NON IMMEDIATE ARGS
142 // lldb-command:print a
143 // lldb-check:[...]$3 = BigStruct { a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10 }
144 // lldb-command:print b
145 // lldb-check:[...]$4 = BigStruct { a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18 }
146 // lldb-command:continue
149 // lldb-command:print a
150 // lldb-check:[...]$5 = 19
151 // lldb-command:print b
152 // lldb-check:[...]$6 = 20
153 // lldb-command:print c
154 // lldb-check:[...]$7 = 21.5
155 // lldb-command:continue
158 // lldb-command:print a
159 // lldb-check:[...]$8 = 22
160 // lldb-command:print b
161 // lldb-check:[...]$9 = 23
162 // lldb-command:print c
163 // lldb-check:[...]$10 = 24.5
164 // lldb-command:continue
167 // lldb-command:print x
168 // lldb-check:[...]$11 = 25
169 // lldb-command:print y
170 // lldb-check:[...]$12 = 26
171 // lldb-command:print z
172 // lldb-check:[...]$13 = 27.5
173 // lldb-command:continue
176 // lldb-command:print x
177 // lldb-check:[...]$14 = 28
178 // lldb-command:print y
179 // lldb-check:[...]$15 = 29
180 // lldb-command:print z
181 // lldb-check:[...]$16 = 30.5
182 // lldb-command:continue
185 // lldb-command:print x
186 // lldb-check:[...]$17 = 31
187 // lldb-command:print y
188 // lldb-check:[...]$18 = 32
189 // lldb-command:print z
190 // lldb-check:[...]$19 = 33.5
191 // lldb-command:continue
194 // lldb-command:print x
195 // lldb-check:[...]$20 = 34
196 // lldb-command:print y
197 // lldb-check:[...]$21 = 35
198 // lldb-command:print z
199 // lldb-check:[...]$22 = 36.5
200 // lldb-command:continue
203 // lldb-command:print x
204 // lldb-check:[...]$23 = 37
205 // lldb-command:print y
206 // lldb-check:[...]$24 = 38
207 // lldb-command:print z
208 // lldb-check:[...]$25 = 39.5
209 // lldb-command:continue
212 // lldb-command:print x
213 // lldb-check:[...]$26 = 40
214 // lldb-command:print y
215 // lldb-check:[...]$27 = 41
216 // lldb-command:print z
217 // lldb-check:[...]$28 = 42
218 // lldb-command:continue
221 // lldb-command:print x
222 // lldb-check:[...]$29 = 43
223 // lldb-command:print y
224 // lldb-check:[...]$30 = 44
225 // lldb-command:print z
226 // lldb-check:[...]$31 = 45
227 // lldb-command:continue
230 #![allow(unused_variables)]
231 #![feature(omit_gdb_pretty_printer_section)]
232 #![omit_gdb_pretty_printer_section]
234 fn immediate_args(a: isize, b: bool, c: f64) {
249 fn non_immediate_args(a: BigStruct, b: BigStruct) {
253 fn binding(a: i64, b: u64, c: f64) {
258 fn assignment(mut a: u64, b: u64, c: f64) {
263 fn function_call(x: u64, y: u64, z: f64) {
267 fn identifier(x: u64, y: u64, z: f64) -> u64 {
271 fn return_expr(x: u64, y: u64, z: f64) -> u64 {
275 fn arithmetic_expr(x: u64, y: u64, z: f64) -> u64 {
279 fn if_expr(x: u64, y: u64, z: f64) -> u64 {
280 if x + y < 1000 { // #break
287 fn while_expr(mut x: u64, y: u64, z: u64) -> u64 {
288 while x + y > 1000 { // #break
294 fn loop_expr(mut x: u64, y: u64, z: u64) -> u64 {
305 immediate_args(1, true, 2.5);
330 binding(19, 20, 21.5);
331 assignment(22, 23, 24.5);
332 function_call(25, 26, 27.5);
333 identifier(28, 29, 30.5);
334 return_expr(31, 32, 33.5);
335 arithmetic_expr(34, 35, 36.5);
336 if_expr(37, 38, 39.5);
337 while_expr(40, 41, 42);
338 loop_expr(43, 44, 45);