]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/simple-tuple.rs
Auto merge of #28816 - petrochenkov:unistruct, r=nrc
[rust.git] / src / test / debuginfo / simple-tuple.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:print/d 'simple_tuple::NO_PADDING_8'
18 // gdb-check:$1 = {__0 = -50, __1 = 50}
19 // gdb-command:print 'simple_tuple::NO_PADDING_16'
20 // gdb-check:$2 = {__0 = -1, __1 = 2, __2 = 3}
21 // gdb-command:print 'simple_tuple::NO_PADDING_32'
22 // gdb-check:$3 = {__0 = 4, __1 = 5, __2 = 6}
23 // gdb-command:print 'simple_tuple::NO_PADDING_64'
24 // gdb-check:$4 = {__0 = 7, __1 = 8, __2 = 9}
25
26 // gdb-command:print 'simple_tuple::INTERNAL_PADDING_1'
27 // gdb-check:$5 = {__0 = 10, __1 = 11}
28 // gdb-command:print 'simple_tuple::INTERNAL_PADDING_2'
29 // gdb-check:$6 = {__0 = 12, __1 = 13, __2 = 14, __3 = 15}
30
31 // gdb-command:print 'simple_tuple::PADDING_AT_END'
32 // gdb-check:$7 = {__0 = 16, __1 = 17}
33
34 // gdb-command:run
35
36 // gdb-command:print/d noPadding8
37 // gdb-check:$8 = {__0 = -100, __1 = 100}
38 // gdb-command:print noPadding16
39 // gdb-check:$9 = {__0 = 0, __1 = 1, __2 = 2}
40 // gdb-command:print noPadding32
41 // gdb-check:$10 = {__0 = 3, __1 = 4.5, __2 = 5}
42 // gdb-command:print noPadding64
43 // gdb-check:$11 = {__0 = 6, __1 = 7.5, __2 = 8}
44
45 // gdb-command:print internalPadding1
46 // gdb-check:$12 = {__0 = 9, __1 = 10}
47 // gdb-command:print internalPadding2
48 // gdb-check:$13 = {__0 = 11, __1 = 12, __2 = 13, __3 = 14}
49
50 // gdb-command:print paddingAtEnd
51 // gdb-check:$14 = {__0 = 15, __1 = 16}
52
53 // gdb-command:print/d 'simple_tuple::NO_PADDING_8'
54 // gdb-check:$15 = {__0 = -127, __1 = 127}
55 // gdb-command:print 'simple_tuple::NO_PADDING_16'
56 // gdb-check:$16 = {__0 = -10, __1 = 10, __2 = 9}
57 // gdb-command:print 'simple_tuple::NO_PADDING_32'
58 // gdb-check:$17 = {__0 = 14, __1 = 15, __2 = 16}
59 // gdb-command:print 'simple_tuple::NO_PADDING_64'
60 // gdb-check:$18 = {__0 = 17, __1 = 18, __2 = 19}
61
62 // gdb-command:print 'simple_tuple::INTERNAL_PADDING_1'
63 // gdb-check:$19 = {__0 = 110, __1 = 111}
64 // gdb-command:print 'simple_tuple::INTERNAL_PADDING_2'
65 // gdb-check:$20 = {__0 = 112, __1 = 113, __2 = 114, __3 = 115}
66
67 // gdb-command:print 'simple_tuple::PADDING_AT_END'
68 // gdb-check:$21 = {__0 = 116, __1 = 117}
69
70
71 // === LLDB TESTS ==================================================================================
72
73 // lldb-command:run
74
75 // lldb-command:print/d noPadding8
76 // lldb-check:[...]$0 = (-100, 100)
77 // lldb-command:print noPadding16
78 // lldb-check:[...]$1 = (0, 1, 2)
79 // lldb-command:print noPadding32
80 // lldb-check:[...]$2 = (3, 4.5, 5)
81 // lldb-command:print noPadding64
82 // lldb-check:[...]$3 = (6, 7.5, 8)
83
84 // lldb-command:print internalPadding1
85 // lldb-check:[...]$4 = (9, 10)
86 // lldb-command:print internalPadding2
87 // lldb-check:[...]$5 = (11, 12, 13, 14)
88
89 // lldb-command:print paddingAtEnd
90 // lldb-check:[...]$6 = (15, 16)
91
92 #![allow(unused_variables)]
93 #![allow(dead_code)]
94 #![feature(omit_gdb_pretty_printer_section)]
95 #![omit_gdb_pretty_printer_section]
96
97 static mut NO_PADDING_8: (i8, u8) = (-50, 50);
98 static mut NO_PADDING_16: (i16, i16, u16) = (-1, 2, 3);
99
100 static mut NO_PADDING_32: (i32, f32, u32) = (4, 5.0, 6);
101 static mut NO_PADDING_64: (i64, f64, u64) = (7, 8.0, 9);
102
103 static mut INTERNAL_PADDING_1: (i16, i32) = (10, 11);
104 static mut INTERNAL_PADDING_2: (i16, i32, u32, u64) = (12, 13, 14, 15);
105
106 static mut PADDING_AT_END: (i32, i16) = (16, 17);
107
108 fn main() {
109     let noPadding8: (i8, u8) = (-100, 100);
110     let noPadding16: (i16, i16, u16) = (0, 1, 2);
111     let noPadding32: (i32, f32, u32) = (3, 4.5, 5);
112     let noPadding64: (i64, f64, u64) = (6, 7.5, 8);
113
114     let internalPadding1: (i16, i32) = (9, 10);
115     let internalPadding2: (i16, i32, u32, u64) = (11, 12, 13, 14);
116
117     let paddingAtEnd: (i32, i16) = (15, 16);
118
119     unsafe {
120         NO_PADDING_8 = (-127, 127);
121         NO_PADDING_16 = (-10, 10, 9);
122
123         NO_PADDING_32 = (14, 15.0, 16);
124         NO_PADDING_64 = (17, 18.0, 19);
125
126         INTERNAL_PADDING_1 = (110, 111);
127         INTERNAL_PADDING_2 = (112, 113, 114, 115);
128
129         PADDING_AT_END = (116, 117);
130     }
131
132     zzz(); // #break
133 }
134
135 fn zzz() {()}