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 // gdb-check:$23 = {x = 3537, y = 35437.5, z = true}
77 // gdb-command:continue
79 // gdb-command:print simple_tuple_ident
80 // gdb-check:$24 = {__0 = 34903493, __1 = 232323}
81 // gdb-command:continue
83 // === LLDB TESTS ==================================================================================
85 // lldb-command:type format add --format hex char
86 // lldb-command:type format add --format hex 'unsigned char'
90 // DESTRUCTURED STRUCT
91 // lldb-command:print x
92 // lldb-check:[...]$0 = 400
93 // lldb-command:print y
94 // lldb-check:[...]$1 = 401.5
95 // lldb-command:print z
96 // lldb-check:[...]$2 = true
97 // lldb-command:continue
100 // lldb-command:print _i8
101 // lldb-check:[...]$3 = 0x6f
102 // lldb-command:print _u8
103 // lldb-check:[...]$4 = 0x70
104 // lldb-command:print _i16
105 // lldb-check:[...]$5 = -113
106 // lldb-command:print _u16
107 // lldb-check:[...]$6 = 114
108 // lldb-command:print _i32
109 // lldb-check:[...]$7 = -115
110 // lldb-command:print _u32
111 // lldb-check:[...]$8 = 116
112 // lldb-command:print _i64
113 // lldb-check:[...]$9 = -117
114 // lldb-command:print _u64
115 // lldb-check:[...]$10 = 118
116 // lldb-command:print _f32
117 // lldb-check:[...]$11 = 119.5
118 // lldb-command:print _f64
119 // lldb-check:[...]$12 = 120.5
120 // lldb-command:continue
123 // lldb-command:print v1
124 // lldb-check:[...]$13 = 80000
125 // lldb-command:print x1
126 // lldb-check:[...]$14 = 8000
127 // lldb-command:print *y1
128 // lldb-check:[...]$15 = 80001.5
129 // lldb-command:print z1
130 // lldb-check:[...]$16 = false
131 // lldb-command:print *x2
132 // lldb-check:[...]$17 = -30000
133 // lldb-command:print y2
134 // lldb-check:[...]$18 = -300001.5
135 // lldb-command:print *z2
136 // lldb-check:[...]$19 = true
137 // lldb-command:print v2
138 // lldb-check:[...]$20 = 854237.5
139 // lldb-command:continue
142 // lldb-command:print i
143 // lldb-check:[...]$21 = 1234
144 // lldb-command:continue
146 // lldb-command:print simple_struct_ident
147 // lldb-check:[...]$22 = Struct { x: 3537, y: 35437.5, z: true }
148 // lldb-command:continue
150 // lldb-command:print simple_tuple_ident
151 // lldb-check:[...]$23 = (34903493, 232323)
152 // lldb-command:continue
154 #![allow(unused_variables)]
155 #![feature(box_patterns)]
156 #![feature(box_syntax)]
157 #![omit_gdb_pretty_printer_section]
173 for &Struct { x, y, z }
in &[s
] {
177 let tuple
: (i8, u8, i16, u16, i32, u32, i64, u64, f32, f64) =
178 (0x6f, 0x70, -113, 114, -115, 116, -117, 118, 119.5, 120.5);
180 for &(_i8
, _u8
, _i16
, _u16
, _i32
, _u32
, _i64
, _u64
, _f32
, _f64
) in &[tuple
] {
184 let more_complex
: (i32, &Struct
, Struct
, Box
<f64>) =
199 &Struct { x: x1, y: ref y1, z: z1 }
,
200 Struct { x: ref x2, y: y2, z: ref z2 }
,
201 box v2
) in [more_complex
].iter() {
205 for i
in 1234..1235 {
209 for simple_struct_ident
in
218 for simple_tuple_ident
in vec
![(34903493u32, 232323i64)] {