]> git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/tuple-struct.rs
Imported Upstream version 1.0.0~beta.3
[rustc.git] / src / test / debuginfo / tuple-struct.rs
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.
4 //
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.
10
11 // min-lldb-version: 310
12
13 // compile-flags:-g
14
15 // === GDB TESTS ===================================================================================
16
17 // gdb-command:run
18
19 // gdb-command:print no_padding16
20 // gdb-check:$1 = {__0 = 10000, __1 = -10001}
21
22 // gdb-command:print no_padding32
23 // gdb-check:$2 = {__0 = -10002, __1 = -10003.5, __2 = 10004}
24
25 // gdb-command:print no_padding64
26 // gdb-check:$3 = {__0 = -10005.5, __1 = 10006, __2 = 10007}
27
28 // gdb-command:print no_padding163264
29 // gdb-check:$4 = {__0 = -10008, __1 = 10009, __2 = 10010, __3 = 10011}
30
31 // gdb-command:print internal_padding
32 // gdb-check:$5 = {__0 = 10012, __1 = -10013}
33
34 // gdb-command:print padding_at_end
35 // gdb-check:$6 = {__0 = -10014, __1 = 10015}
36
37
38 // === LLDB TESTS ==================================================================================
39
40 // lldb-command:run
41
42 // lldb-command:print no_padding16
43 // lldb-check:[...]$0 = NoPadding16(10000, -10001)
44
45 // lldb-command:print no_padding32
46 // lldb-check:[...]$1 = NoPadding32(-10002, -10003.5, 10004)
47
48 // lldb-command:print no_padding64
49 // lldb-check:[...]$2 = NoPadding64(-10005.5, 10006, 10007)
50
51 // lldb-command:print no_padding163264
52 // lldb-check:[...]$3 = NoPadding163264(-10008, 10009, 10010, 10011)
53
54 // lldb-command:print internal_padding
55 // lldb-check:[...]$4 = InternalPadding(10012, -10013)
56
57 // lldb-command:print padding_at_end
58 // lldb-check:[...]$5 = PaddingAtEnd(-10014, 10015)
59
60 // This test case mainly makes sure that no field names are generated for tuple structs (as opposed
61 // to all fields having the name "<unnamed_field>"). Otherwise they are handled the same a normal
62 // structs.
63
64
65 #![omit_gdb_pretty_printer_section]
66
67 struct NoPadding16(u16, i16);
68 struct NoPadding32(i32, f32, u32);
69 struct NoPadding64(f64, i64, u64);
70 struct NoPadding163264(i16, u16, i32, u64);
71 struct InternalPadding(u16, i64);
72 struct PaddingAtEnd(i64, u16);
73
74 fn main() {
75 let no_padding16 = NoPadding16(10000, -10001);
76 let no_padding32 = NoPadding32(-10002, -10003.5, 10004);
77 let no_padding64 = NoPadding64(-10005.5, 10006, 10007);
78 let no_padding163264 = NoPadding163264(-10008, 10009, 10010, 10011);
79
80 let internal_padding = InternalPadding(10012, -10013);
81 let padding_at_end = PaddingAtEnd(-10014, 10015);
82
83 zzz(); // #break
84 }
85
86 fn zzz() {()}