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