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 // ignore-tidy-linelength
12 // min-lldb-version: 310
16 // === GDB TESTS ===================================================================================
20 // gdb-command:print tuple_interior_padding
21 // gdb-check:$1 = {__0 = 0, __1 = OneHundred}
23 // gdb-command:print tuple_padding_at_end
24 // gdb-check:$2 = {__0 = {__0 = 1, __1 = OneThousand}, __1 = 2}
26 // gdb-command:print tuple_different_enums
27 // gdb-check:$3 = {__0 = OneThousand, __1 = MountainView, __2 = OneMillion, __3 = Vienna}
29 // gdb-command:print padded_struct
30 // gdb-check:$4 = {a = 3, b = OneMillion, c = 4, d = Toronto, e = 5}
32 // gdb-command:print packed_struct
33 // gdb-check:$5 = {a = 6, b = OneHundred, c = 7, d = Vienna, e = 8}
35 // gdb-command:print non_padded_struct
36 // gdb-check:$6 = {a = OneMillion, b = MountainView, c = OneThousand, d = Toronto}
38 // gdb-command:print struct_with_drop
39 // gdb-check:$7 = {__0 = {a = OneHundred, b = Vienna}, __1 = 9}
42 // === LLDB TESTS ==================================================================================
46 // lldb-command:print tuple_interior_padding
47 // lldb-check:[...]$0 = (0, OneHundred)
49 // lldb-command:print tuple_padding_at_end
50 // lldb-check:[...]$1 = ((1, OneThousand), 2)
51 // lldb-command:print tuple_different_enums
52 // lldb-check:[...]$2 = (OneThousand, MountainView, OneMillion, Vienna)
54 // lldb-command:print padded_struct
55 // lldb-check:[...]$3 = PaddedStruct { a: 3, b: OneMillion, c: 4, d: Toronto, e: 5 }
57 // lldb-command:print packed_struct
58 // lldb-check:[...]$4 = PackedStruct { a: 6, b: OneHundred, c: 7, d: Vienna, e: 8 }
60 // lldb-command:print non_padded_struct
61 // lldb-check:[...]$5 = NonPaddedStruct { a: OneMillion, b: MountainView, c: OneThousand, d: Toronto }
63 // lldb-command:print struct_with_drop
64 // lldb-check:[...]$6 = (StructWithDrop { a: OneHundred, b: Vienna }, 9)
66 #![allow(unused_variables)]
67 #![omit_gdb_pretty_printer_section]
69 use self::AnEnum
::{OneHundred, OneThousand, OneMillion}
;
70 use self::AnotherEnum
::{MountainView, Toronto, Vienna}
;
101 struct NonPaddedStruct
{
108 struct StructWithDrop
{
113 impl Drop
for StructWithDrop
{
114 fn drop(&mut self) {()}
119 let tuple_interior_padding
= (0_i16, OneHundred
);
120 // It will depend on the machine architecture if any padding is actually involved here
121 let tuple_padding_at_end
= ((1_u64, OneThousand
), 2_u64);
122 let tuple_different_enums
= (OneThousand
, MountainView
, OneMillion
, Vienna
);
124 let padded_struct
= PaddedStruct
{
132 let packed_struct
= PackedStruct
{
140 let non_padded_struct
= NonPaddedStruct
{
147 let struct_with_drop
= (StructWithDrop { a: OneHundred, b: Vienna }
, 9_i64);