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
15 // === GDB TESTS ===================================================================================
19 // DESTRUCTURED STRUCT
20 // gdb-command:print x
22 // gdb-command:print y
23 // gdb-check:$2 = 401.5
24 // gdb-command:print z
25 // gdb-check:$3 = true
26 // gdb-command:continue
29 // gdb-command:print/x _i8
30 // gdb-check:$4 = 0x6f
31 // gdb-command:print/x _u8
32 // gdb-check:$5 = 0x70
33 // gdb-command:print _i16
34 // gdb-check:$6 = -113
35 // gdb-command:print _u16
37 // gdb-command:print _i32
38 // gdb-check:$8 = -115
39 // gdb-command:print _u32
41 // gdb-command:print _i64
42 // gdb-check:$10 = -117
43 // gdb-command:print _u64
44 // gdb-check:$11 = 118
45 // gdb-command:print _f32
46 // gdb-check:$12 = 119.5
47 // gdb-command:print _f64
48 // gdb-check:$13 = 120.5
49 // gdb-command:continue
52 // gdb-command:print v1
53 // gdb-check:$14 = 80000
54 // gdb-command:print x1
55 // gdb-check:$15 = 8000
56 // gdb-command:print *y1
57 // gdb-check:$16 = 80001.5
58 // gdb-command:print z1
59 // gdb-check:$17 = false
60 // gdb-command:print *x2
61 // gdb-check:$18 = -30000
62 // gdb-command:print y2
63 // gdb-check:$19 = -300001.5
64 // gdb-command:print *z2
65 // gdb-check:$20 = true
66 // gdb-command:print v2
67 // gdb-check:$21 = 854237.5
68 // gdb-command:continue
71 // gdb-command:print i
72 // gdb-check:$22 = 1234
73 // gdb-command:continue
75 // gdb-command:print simple_struct_ident
76 // gdbg-check:$23 = {x = 3537, y = 35437.5, z = true}
77 // gdbr-check:$23 = destructured_for_loop_variable::Struct {x: 3537, y: 35437.5, z: true}
78 // gdb-command:continue
80 // gdb-command:print simple_tuple_ident
81 // gdbg-check:$24 = {__0 = 34903493, __1 = 232323}
82 // gdbr-check:$24 = (34903493, 232323)
83 // gdb-command:continue
85 // === LLDB TESTS ==================================================================================
87 // lldb-command:type format add --format hex char
88 // lldb-command:type format add --format hex 'unsigned char'
92 // DESTRUCTURED STRUCT
93 // lldb-command:print x
94 // lldb-check:[...]$0 = 400
95 // lldb-command:print y
96 // lldb-check:[...]$1 = 401.5
97 // lldb-command:print z
98 // lldb-check:[...]$2 = true
99 // lldb-command:continue
101 // DESTRUCTURED TUPLE
102 // lldb-command:print _i8
103 // lldb-check:[...]$3 = 0x6f
104 // lldb-command:print _u8
105 // lldb-check:[...]$4 = 0x70
106 // lldb-command:print _i16
107 // lldb-check:[...]$5 = -113
108 // lldb-command:print _u16
109 // lldb-check:[...]$6 = 114
110 // lldb-command:print _i32
111 // lldb-check:[...]$7 = -115
112 // lldb-command:print _u32
113 // lldb-check:[...]$8 = 116
114 // lldb-command:print _i64
115 // lldb-check:[...]$9 = -117
116 // lldb-command:print _u64
117 // lldb-check:[...]$10 = 118
118 // lldb-command:print _f32
119 // lldb-check:[...]$11 = 119.5
120 // lldb-command:print _f64
121 // lldb-check:[...]$12 = 120.5
122 // lldb-command:continue
125 // lldb-command:print v1
126 // lldb-check:[...]$13 = 80000
127 // lldb-command:print x1
128 // lldb-check:[...]$14 = 8000
129 // lldb-command:print *y1
130 // lldb-check:[...]$15 = 80001.5
131 // lldb-command:print z1
132 // lldb-check:[...]$16 = false
133 // lldb-command:print *x2
134 // lldb-check:[...]$17 = -30000
135 // lldb-command:print y2
136 // lldb-check:[...]$18 = -300001.5
137 // lldb-command:print *z2
138 // lldb-check:[...]$19 = true
139 // lldb-command:print v2
140 // lldb-check:[...]$20 = 854237.5
141 // lldb-command:continue
144 // lldb-command:print i
145 // lldb-check:[...]$21 = 1234
146 // lldb-command:continue
148 // lldb-command:print simple_struct_ident
149 // lldb-check:[...]$22 = Struct { x: 3537, y: 35437.5, z: true }
150 // lldb-command:continue
152 // lldb-command:print simple_tuple_ident
153 // lldb-check:[...]$23 = (34903493, 232323)
154 // lldb-command:continue
156 #![allow(unused_variables)]
157 #![feature(box_patterns)]
158 #![feature(box_syntax)]
159 #![feature(omit_gdb_pretty_printer_section)]
160 #![omit_gdb_pretty_printer_section]
176 for &Struct { x, y, z }
in &[s
] {
180 let tuple
: (i8, u8, i16, u16, i32, u32, i64, u64, f32, f64) =
181 (0x6f, 0x70, -113, 114, -115, 116, -117, 118, 119.5, 120.5);
183 for &(_i8
, _u8
, _i16
, _u16
, _i32
, _u32
, _i64
, _u64
, _f32
, _f64
) in &[tuple
] {
187 let more_complex
: (i32, &Struct
, Struct
, Box
<f64>) =
202 &Struct { x: x1, y: ref y1, z: z1 }
,
203 Struct { x: ref x2, y: y2, z: ref z2 }
,
204 box v2
) in [more_complex
].iter() {
208 for i
in 1234..1235 {
212 for simple_struct_ident
in
221 for simple_tuple_ident
in vec
![(34903493u32, 232323i64)] {