2024-04-15 06:44:14 -05:00
|
|
|
//@ ignore-gdb-version: 15.0 - 99.0
|
|
|
|
// ^ test temporarily disabled as it fails under gdb 15
|
2014-04-24 04:35:48 -05:00
|
|
|
|
|
|
|
//@ compile-flags:-g
|
2014-07-09 07:46:09 -05:00
|
|
|
|
|
|
|
// === GDB TESTS ===================================================================================
|
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:run
|
|
|
|
// gdb-command:print empty.length
|
|
|
|
// gdb-check:$1 = 0
|
|
|
|
|
|
|
|
// gdb-command:print singleton.length
|
|
|
|
// gdb-check:$2 = 1
|
2024-08-17 16:31:49 -05:00
|
|
|
// gdb-command:print *(singleton.data_ptr as *const [i64; 1])
|
|
|
|
// gdb-check:$3 = [1]
|
2014-04-24 04:35:48 -05:00
|
|
|
|
|
|
|
// gdb-command:print multiple.length
|
|
|
|
// gdb-check:$4 = 4
|
2024-08-17 16:31:49 -05:00
|
|
|
// gdb-command:print *(multiple.data_ptr as *const [i64; 4])
|
|
|
|
// gdb-check:$5 = [2, 3, 4, 5]
|
2014-04-24 04:35:48 -05:00
|
|
|
|
|
|
|
// gdb-command:print slice_of_slice.length
|
|
|
|
// gdb-check:$6 = 2
|
2024-08-17 16:31:49 -05:00
|
|
|
// gdb-command:print *(slice_of_slice.data_ptr as *const [i64; 2])
|
|
|
|
// gdb-check:$7 = [3, 4]
|
2014-04-24 04:35:48 -05:00
|
|
|
|
|
|
|
// gdb-command:print padded_tuple.length
|
|
|
|
// gdb-check:$8 = 2
|
|
|
|
// gdb-command:print padded_tuple.data_ptr[0]
|
2024-08-17 16:31:49 -05:00
|
|
|
// gdb-check:$9 = (6, 7)
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print padded_tuple.data_ptr[1]
|
2024-08-17 16:31:49 -05:00
|
|
|
// gdb-check:$10 = (8, 9)
|
2014-04-24 04:35:48 -05:00
|
|
|
|
|
|
|
// gdb-command:print padded_struct.length
|
|
|
|
// gdb-check:$11 = 2
|
|
|
|
// gdb-command:print padded_struct.data_ptr[0]
|
2024-08-17 16:31:49 -05:00
|
|
|
// gdb-check:$12 = vec_slices::AStruct {x: 10, y: 11, z: 12}
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print padded_struct.data_ptr[1]
|
2024-08-17 16:31:49 -05:00
|
|
|
// gdb-check:$13 = vec_slices::AStruct {x: 13, y: 14, z: 15}
|
2014-04-24 04:35:48 -05:00
|
|
|
|
2022-01-17 10:31:13 -06:00
|
|
|
// gdb-command:print mut_slice.length
|
2022-01-25 05:14:17 -06:00
|
|
|
// gdb-check:$14 = 5
|
2024-08-17 16:31:49 -05:00
|
|
|
// gdb-command:print *(mut_slice.data_ptr as *const [i64; 5])
|
|
|
|
// gdb-check:$15 = [1, 2, 3, 4, 5]
|
2016-06-29 09:34:06 -05:00
|
|
|
|
2024-08-17 16:31:49 -05:00
|
|
|
// gdb-command:print MUT_VECT_SLICE.length
|
|
|
|
// gdb-check:$16 = 2
|
|
|
|
// gdb-command:print *(MUT_VECT_SLICE.data_ptr as *const [i64; 2])
|
|
|
|
// gdb-check:$17 = [64, 65]
|
2014-07-09 07:46:09 -05:00
|
|
|
|
|
|
|
// === LLDB TESTS ==================================================================================
|
|
|
|
|
|
|
|
// lldb-command:run
|
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v empty
|
2024-08-18 16:00:33 -05:00
|
|
|
// lldb-check:[...] size=0
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v singleton
|
2024-08-18 16:00:33 -05:00
|
|
|
// lldb-check:[...] size=1 { [0] = 1 }
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v multiple
|
2024-08-18 16:00:33 -05:00
|
|
|
// lldb-check:[...] size=4 { [0] = 2 [1] = 3 [2] = 4 [3] = 5 }
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v slice_of_slice
|
2024-08-18 16:00:33 -05:00
|
|
|
// lldb-check:[...] size=2 { [0] = 3 [1] = 4 }
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v padded_tuple
|
2024-08-18 16:00:33 -05:00
|
|
|
// lldb-check:[...] size=2 { [0] = { 0 = 6 1 = 7 } [1] = { 0 = 8 1 = 9 } }
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v padded_struct
|
2024-08-18 16:00:33 -05:00
|
|
|
// lldb-check:[...] size=2 { [0] = { x = 10 y = 11 z = 12 } [1] = { x = 13 y = 14 z = 15 } }
|
2014-07-09 07:46:09 -05:00
|
|
|
|
2015-04-21 23:53:07 -05:00
|
|
|
#![allow(dead_code, unused_variables)]
|
2015-09-19 15:33:47 -05:00
|
|
|
#![feature(omit_gdb_pretty_printer_section)]
|
2014-12-03 16:48:18 -06:00
|
|
|
#![omit_gdb_pretty_printer_section]
|
2014-04-24 04:35:48 -05:00
|
|
|
|
|
|
|
struct AStruct {
|
|
|
|
x: i16,
|
|
|
|
y: i32,
|
2022-01-25 05:14:17 -06:00
|
|
|
z: i16,
|
2014-04-24 04:35:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static VECT_SLICE: &'static [i64] = &[64, 65];
|
|
|
|
static mut MUT_VECT_SLICE: &'static [i64] = &[32];
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let empty: &[i64] = &[];
|
|
|
|
let singleton: &[i64] = &[1];
|
|
|
|
let multiple: &[i64] = &[2, 3, 4, 5];
|
2015-01-02 18:34:13 -06:00
|
|
|
let slice_of_slice = &multiple[1..3];
|
2014-04-24 04:35:48 -05:00
|
|
|
|
|
|
|
let padded_tuple: &[(i32, i16)] = &[(6, 7), (8, 9)];
|
|
|
|
|
2022-01-25 05:14:17 -06:00
|
|
|
let padded_struct: &[AStruct] =
|
|
|
|
&[AStruct { x: 10, y: 11, z: 12 }, AStruct { x: 13, y: 14, z: 15 }];
|
2014-04-24 04:35:48 -05:00
|
|
|
|
|
|
|
unsafe {
|
|
|
|
MUT_VECT_SLICE = VECT_SLICE;
|
|
|
|
}
|
|
|
|
|
2016-06-29 09:34:06 -05:00
|
|
|
let mut_slice: &mut [i64] = &mut [1, 2, 3, 4, 5];
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
}
|
|
|
|
|
2022-01-25 05:14:17 -06:00
|
|
|
fn zzz() {
|
|
|
|
()
|
|
|
|
}
|