]>
git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/function-arg-initialization.rs
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 // min-lldb-version: 310
13 // This test case checks if function arguments already have the correct value
14 // when breaking at the first line of the function, that is if the function
15 // prologue has already been executed at the first line. Note that because of
16 // the __morestack part of the prologue GDB incorrectly breaks at before the
17 // arguments have been properly loaded when setting the breakpoint via the
22 // === GDB TESTS ===================================================================================
27 // gdb-command:print a
29 // gdb-command:print b
30 // gdb-check:$2 = true
31 // gdb-command:print c
33 // gdb-command:continue
36 // gdb-command:print a
37 // gdb-check:$4 = {a = 3, b = 4, c = 5, d = 6, e = 7, f = 8, g = 9, h = 10}
38 // gdb-command:print b
39 // gdb-check:$5 = {a = 11, b = 12, c = 13, d = 14, e = 15, f = 16, g = 17, h = 18}
40 // gdb-command:continue
43 // gdb-command:print a
45 // gdb-command:print b
47 // gdb-command:print c
48 // gdb-check:$8 = 21.5
49 // gdb-command:continue
52 // gdb-command:print a
54 // gdb-command:print b
56 // gdb-command:print c
57 // gdb-check:$11 = 24.5
58 // gdb-command:continue
61 // gdb-command:print x
63 // gdb-command:print y
65 // gdb-command:print z
66 // gdb-check:$14 = 27.5
67 // gdb-command:continue
70 // gdb-command:print x
72 // gdb-command:print y
74 // gdb-command:print z
75 // gdb-check:$17 = 30.5
76 // gdb-command:continue
79 // gdb-command:print x
81 // gdb-command:print y
83 // gdb-command:print z
84 // gdb-check:$20 = 33.5
85 // gdb-command:continue
88 // gdb-command:print x
90 // gdb-command:print y
92 // gdb-command:print z
93 // gdb-check:$23 = 36.5
94 // gdb-command:continue
97 // gdb-command:print x
99 // gdb-command:print y
100 // gdb-check:$25 = 38
101 // gdb-command:print z
102 // gdb-check:$26 = 39.5
103 // gdb-command:continue
106 // gdb-command:print x
107 // gdb-check:$27 = 40
108 // gdb-command:print y
109 // gdb-check:$28 = 41
110 // gdb-command:print z
111 // gdb-check:$29 = 42
112 // gdb-command:continue
115 // gdb-command:print x
116 // gdb-check:$30 = 43
117 // gdb-command:print y
118 // gdb-check:$31 = 44
119 // gdb-command:print z
120 // gdb-check:$32 = 45
121 // gdb-command:continue
124 // === LLDB TESTS ==================================================================================
129 // lldb-command:print a
130 // lldb-check:[...]$0 = 1
131 // lldb-command:print b
132 // lldb-check:[...]$1 = true
133 // lldb-command:print c
134 // lldb-check:[...]$2 = 2.5
135 // lldb-command:continue
137 // NON IMMEDIATE ARGS
138 // lldb-command:print a
139 // lldb-check:[...]$3 = BigStruct { a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10 }
140 // lldb-command:print b
141 // lldb-check:[...]$4 = BigStruct { a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18 }
142 // lldb-command:continue
145 // lldb-command:print a
146 // lldb-check:[...]$5 = 19
147 // lldb-command:print b
148 // lldb-check:[...]$6 = 20
149 // lldb-command:print c
150 // lldb-check:[...]$7 = 21.5
151 // lldb-command:continue
154 // lldb-command:print a
155 // lldb-check:[...]$8 = 22
156 // lldb-command:print b
157 // lldb-check:[...]$9 = 23
158 // lldb-command:print c
159 // lldb-check:[...]$10 = 24.5
160 // lldb-command:continue
163 // lldb-command:print x
164 // lldb-check:[...]$11 = 25
165 // lldb-command:print y
166 // lldb-check:[...]$12 = 26
167 // lldb-command:print z
168 // lldb-check:[...]$13 = 27.5
169 // lldb-command:continue
172 // lldb-command:print x
173 // lldb-check:[...]$14 = 28
174 // lldb-command:print y
175 // lldb-check:[...]$15 = 29
176 // lldb-command:print z
177 // lldb-check:[...]$16 = 30.5
178 // lldb-command:continue
181 // lldb-command:print x
182 // lldb-check:[...]$17 = 31
183 // lldb-command:print y
184 // lldb-check:[...]$18 = 32
185 // lldb-command:print z
186 // lldb-check:[...]$19 = 33.5
187 // lldb-command:continue
190 // lldb-command:print x
191 // lldb-check:[...]$20 = 34
192 // lldb-command:print y
193 // lldb-check:[...]$21 = 35
194 // lldb-command:print z
195 // lldb-check:[...]$22 = 36.5
196 // lldb-command:continue
199 // lldb-command:print x
200 // lldb-check:[...]$23 = 37
201 // lldb-command:print y
202 // lldb-check:[...]$24 = 38
203 // lldb-command:print z
204 // lldb-check:[...]$25 = 39.5
205 // lldb-command:continue
208 // lldb-command:print x
209 // lldb-check:[...]$26 = 40
210 // lldb-command:print y
211 // lldb-check:[...]$27 = 41
212 // lldb-command:print z
213 // lldb-check:[...]$28 = 42
214 // lldb-command:continue
217 // lldb-command:print x
218 // lldb-check:[...]$29 = 43
219 // lldb-command:print y
220 // lldb-check:[...]$30 = 44
221 // lldb-command:print z
222 // lldb-check:[...]$31 = 45
223 // lldb-command:continue
226 #![allow(unused_variables)]
227 #![feature(omit_gdb_pretty_printer_section)]
228 #![omit_gdb_pretty_printer_section]
230 fn immediate_args(a
: isize, b
: bool
, c
: f64) {
245 fn non_immediate_args(a
: BigStruct
, b
: BigStruct
) {
249 fn binding(a
: i64, b
: u64, c
: f64) {
254 fn assignment(mut a
: u64, b
: u64, c
: f64) {
259 fn function_call(x
: u64, y
: u64, z
: f64) {
263 fn identifier(x
: u64, y
: u64, z
: f64) -> u64 {
267 fn return_expr(x
: u64, y
: u64, z
: f64) -> u64 {
271 fn arithmetic_expr(x
: u64, y
: u64, z
: f64) -> u64 {
275 fn if_expr(x
: u64, y
: u64, z
: f64) -> u64 {
276 if x
+ y
< 1000 { // #break
283 fn while_expr(mut x
: u64, y
: u64, z
: u64) -> u64 {
284 while x
+ y
> 1000 { // #break
290 fn loop_expr(mut x
: u64, y
: u64, z
: u64) -> u64 {
301 immediate_args(1, true, 2.5);
326 binding(19, 20, 21.5);
327 assignment(22, 23, 24.5);
328 function_call(25, 26, 27.5);
329 identifier(28, 29, 30.5);
330 return_expr(31, 32, 33.5);
331 arithmetic_expr(34, 35, 36.5);
332 if_expr(37, 38, 39.5);
333 while_expr(40, 41, 42);
334 loop_expr(43, 44, 45);