2014-12-19 11:46:04 +00:00
|
|
|
//@ compile-flags:-g
|
|
|
|
|
|
|
|
// === GDB TESTS ===================================================================================
|
|
|
|
|
|
|
|
// gdb-command:run
|
|
|
|
|
|
|
|
// DESTRUCTURED STRUCT
|
|
|
|
// gdb-command:print x
|
|
|
|
// gdb-check:$1 = 400
|
|
|
|
// gdb-command:print y
|
|
|
|
// gdb-check:$2 = 401.5
|
|
|
|
// gdb-command:print z
|
|
|
|
// gdb-check:$3 = true
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// DESTRUCTURED TUPLE
|
|
|
|
// gdb-command:print/x _i8
|
|
|
|
// gdb-check:$4 = 0x6f
|
|
|
|
// gdb-command:print/x _u8
|
|
|
|
// gdb-check:$5 = 0x70
|
|
|
|
// gdb-command:print _i16
|
|
|
|
// gdb-check:$6 = -113
|
|
|
|
// gdb-command:print _u16
|
|
|
|
// gdb-check:$7 = 114
|
|
|
|
// gdb-command:print _i32
|
|
|
|
// gdb-check:$8 = -115
|
|
|
|
// gdb-command:print _u32
|
|
|
|
// gdb-check:$9 = 116
|
|
|
|
// gdb-command:print _i64
|
|
|
|
// gdb-check:$10 = -117
|
|
|
|
// gdb-command:print _u64
|
|
|
|
// gdb-check:$11 = 118
|
|
|
|
// gdb-command:print _f32
|
|
|
|
// gdb-check:$12 = 119.5
|
|
|
|
// gdb-command:print _f64
|
|
|
|
// gdb-check:$13 = 120.5
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// MORE COMPLEX CASE
|
|
|
|
// gdb-command:print v1
|
|
|
|
// gdb-check:$14 = 80000
|
|
|
|
// gdb-command:print x1
|
|
|
|
// gdb-check:$15 = 8000
|
|
|
|
// gdb-command:print *y1
|
|
|
|
// gdb-check:$16 = 80001.5
|
|
|
|
// gdb-command:print z1
|
|
|
|
// gdb-check:$17 = false
|
|
|
|
// gdb-command:print *x2
|
|
|
|
// gdb-check:$18 = -30000
|
|
|
|
// gdb-command:print y2
|
|
|
|
// gdb-check:$19 = -300001.5
|
|
|
|
// gdb-command:print *z2
|
|
|
|
// gdb-check:$20 = true
|
|
|
|
// gdb-command:print v2
|
|
|
|
// gdb-check:$21 = 854237.5
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// SIMPLE IDENTIFIER
|
|
|
|
// gdb-command:print i
|
|
|
|
// gdb-check:$22 = 1234
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print simple_struct_ident
|
2024-08-17 21:31:49 +00:00
|
|
|
// gdb-check:$23 = destructured_for_loop_variable::Struct {x: 3537, y: 35437.5, z: true}
|
2014-12-19 11:46:04 +00:00
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print simple_tuple_ident
|
2024-08-17 21:31:49 +00:00
|
|
|
// gdb-check:$24 = (34903493, 232323)
|
2014-12-19 11:46:04 +00:00
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// === LLDB TESTS ==================================================================================
|
|
|
|
|
|
|
|
// lldb-command:type format add --format hex char
|
|
|
|
// lldb-command:type format add --format hex 'unsigned char'
|
|
|
|
|
|
|
|
// lldb-command:run
|
|
|
|
|
|
|
|
// DESTRUCTURED STRUCT
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v x
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] 400
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v y
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] 401.5
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v z
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] true
|
2014-12-19 11:46:04 +00:00
|
|
|
// lldb-command:continue
|
|
|
|
|
|
|
|
// DESTRUCTURED TUPLE
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v _i8
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] 0x6f
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v _u8
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] 0x70
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v _i16
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] -113
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v _u16
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] 114
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v _i32
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] -115
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v _u32
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] 116
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v _i64
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] -117
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v _u64
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] 118
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v _f32
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] 119.5
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v _f64
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] 120.5
|
2014-12-19 11:46:04 +00:00
|
|
|
// lldb-command:continue
|
|
|
|
|
|
|
|
// MORE COMPLEX CASE
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v v1
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] 80000
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v x1
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] 8000
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v *y1
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] 80001.5
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v z1
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] false
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v *x2
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] -30000
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v y2
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] -300001.5
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v *z2
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] true
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v v2
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] 854237.5
|
2014-12-19 11:46:04 +00:00
|
|
|
// lldb-command:continue
|
|
|
|
|
|
|
|
// SIMPLE IDENTIFIER
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v i
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] 1234
|
2014-12-19 11:46:04 +00:00
|
|
|
// lldb-command:continue
|
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v simple_struct_ident
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] { x = 3537 y = 35437.5 z = true }
|
2014-12-19 11:46:04 +00:00
|
|
|
// lldb-command:continue
|
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v simple_tuple_ident
|
2024-08-18 21:00:33 +00:00
|
|
|
// lldb-check:[...] { 0 = 34903493 1 = 232323 }
|
2014-12-19 11:46:04 +00:00
|
|
|
// lldb-command:continue
|
|
|
|
|
2014-12-03 22:48:18 +00:00
|
|
|
#![allow(unused_variables)]
|
2015-02-11 10:44:20 +00:00
|
|
|
#![feature(box_patterns)]
|
2015-09-19 20:33:47 +00:00
|
|
|
#![feature(omit_gdb_pretty_printer_section)]
|
2014-12-03 22:48:18 +00:00
|
|
|
#![omit_gdb_pretty_printer_section]
|
|
|
|
|
2014-12-19 11:46:04 +00:00
|
|
|
struct Struct {
|
|
|
|
x: i16,
|
|
|
|
y: f32,
|
|
|
|
z: bool
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
|
|
|
let s = Struct {
|
|
|
|
x: 400,
|
|
|
|
y: 401.5,
|
|
|
|
z: true
|
|
|
|
};
|
|
|
|
|
2015-01-31 17:20:46 +00:00
|
|
|
for &Struct { x, y, z } in &[s] {
|
2014-12-19 11:46:04 +00:00
|
|
|
zzz(); // #break
|
|
|
|
}
|
|
|
|
|
|
|
|
let tuple: (i8, u8, i16, u16, i32, u32, i64, u64, f32, f64) =
|
|
|
|
(0x6f, 0x70, -113, 114, -115, 116, -117, 118, 119.5, 120.5);
|
|
|
|
|
2015-01-31 17:20:46 +00:00
|
|
|
for &(_i8, _u8, _i16, _u16, _i32, _u32, _i64, _u64, _f32, _f64) in &[tuple] {
|
2014-12-19 11:46:04 +00:00
|
|
|
zzz(); // #break
|
|
|
|
}
|
|
|
|
|
|
|
|
let more_complex: (i32, &Struct, Struct, Box<f64>) =
|
|
|
|
(80000,
|
|
|
|
&Struct {
|
|
|
|
x: 8000,
|
|
|
|
y: 80001.5,
|
|
|
|
z: false
|
|
|
|
},
|
|
|
|
Struct {
|
|
|
|
x: -30000,
|
|
|
|
y: -300001.5,
|
|
|
|
z: true
|
|
|
|
},
|
2021-08-25 00:39:40 +00:00
|
|
|
Box::new(854237.5));
|
2014-12-19 11:46:04 +00:00
|
|
|
|
|
|
|
for &(v1,
|
|
|
|
&Struct { x: x1, y: ref y1, z: z1 },
|
|
|
|
Struct { x: ref x2, y: y2, z: ref z2 },
|
|
|
|
box v2) in [more_complex].iter() {
|
|
|
|
zzz(); // #break
|
|
|
|
}
|
|
|
|
|
2015-01-25 21:05:03 +00:00
|
|
|
for i in 1234..1235 {
|
2014-12-19 11:46:04 +00:00
|
|
|
zzz(); // #break
|
|
|
|
}
|
|
|
|
|
|
|
|
for simple_struct_ident in
|
|
|
|
vec![Struct {
|
|
|
|
x: 3537,
|
|
|
|
y: 35437.5,
|
|
|
|
z: true
|
|
|
|
}].into_iter() {
|
|
|
|
zzz(); // #break
|
|
|
|
}
|
|
|
|
|
2015-02-01 01:03:04 +00:00
|
|
|
for simple_tuple_ident in vec![(34903493u32, 232323i64)] {
|
2014-12-19 11:46:04 +00:00
|
|
|
zzz(); // #break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn zzz() {()}
|