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.
12 // min-lldb-version: 310
16 // === GDB TESTS ===================================================================================
19 // gdb-command:print empty.length
22 // gdb-command:print singleton.length
24 // gdb-command:print *((int64_t[1]*)(singleton.data_ptr))
27 // gdb-command:print multiple.length
29 // gdb-command:print *((int64_t[4]*)(multiple.data_ptr))
30 // gdb-check:$5 = {2, 3, 4, 5}
32 // gdb-command:print slice_of_slice.length
34 // gdb-command:print *((int64_t[2]*)(slice_of_slice.data_ptr))
35 // gdb-check:$7 = {3, 4}
37 // gdb-command:print padded_tuple.length
39 // gdb-command:print padded_tuple.data_ptr[0]
40 // gdb-check:$9 = {__0 = 6, __1 = 7}
41 // gdb-command:print padded_tuple.data_ptr[1]
42 // gdb-check:$10 = {__0 = 8, __1 = 9}
44 // gdb-command:print padded_struct.length
46 // gdb-command:print padded_struct.data_ptr[0]
47 // gdb-check:$12 = {x = 10, y = 11, z = 12}
48 // gdb-command:print padded_struct.data_ptr[1]
49 // gdb-check:$13 = {x = 13, y = 14, z = 15}
51 // gdb-command:print 'vec_slices::MUT_VECT_SLICE'.length
53 // gdb-command:print *((int64_t[2]*)('vec_slices::MUT_VECT_SLICE'.data_ptr))
54 // gdb-check:$15 = {64, 65}
57 // === LLDB TESTS ==================================================================================
61 // lldb-command:print empty
62 // lldb-check:[...]$0 = &[]
64 // lldb-command:print singleton
65 // lldb-check:[...]$1 = &[1]
67 // lldb-command:print multiple
68 // lldb-check:[...]$2 = &[2, 3, 4, 5]
70 // lldb-command:print slice_of_slice
71 // lldb-check:[...]$3 = &[3, 4]
73 // lldb-command:print padded_tuple
74 // lldb-check:[...]$4 = &[(6, 7), (8, 9)]
76 // lldb-command:print padded_struct
77 // lldb-check:[...]$5 = &[AStruct { x: 10, y: 11, z: 12 }, AStruct { x: 13, y: 14, z: 15 }]
79 #![allow(dead_code, unused_variables)]
80 #![feature(omit_gdb_pretty_printer_section)]
81 #![omit_gdb_pretty_printer_section]
89 static VECT_SLICE: &'static [i64] = &[64, 65];
90 static mut MUT_VECT_SLICE: &'static [i64] = &[32];
93 let empty: &[i64] = &[];
94 let singleton: &[i64] = &[1];
95 let multiple: &[i64] = &[2, 3, 4, 5];
96 let slice_of_slice = &multiple[1..3];
98 let padded_tuple: &[(i32, i16)] = &[(6, 7), (8, 9)];
100 let padded_struct: &[AStruct] = &[
101 AStruct { x: 10, y: 11, z: 12 },
102 AStruct { x: 13, y: 14, z: 15 }
106 MUT_VECT_SLICE = VECT_SLICE;