]> git.proxmox.com Git - rustc.git/blame - src/test/debuginfo/evec-in-struct.rs
New upstream version 1.31.0~beta.4+dfsg1
[rustc.git] / src / test / debuginfo / evec-in-struct.rs
CommitLineData
1a4d82fc
JJ
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
0bf4aa26
XL
11// ignore-tidy-linelength
12
1a4d82fc
JJ
13// min-lldb-version: 310
14
15// compile-flags:-g
16
17// === GDB TESTS ===================================================================================
18
19// gdb-command:run
20
21// gdb-command:print no_padding1
c30ab7b3
SL
22// gdbg-check:$1 = {x = {0, 1, 2}, y = -3, z = {4.5, 5.5}}
23// gdbr-check:$1 = evec_in_struct::NoPadding1 {x: [0, 1, 2], y: -3, z: [4.5, 5.5]}
1a4d82fc 24// gdb-command:print no_padding2
c30ab7b3
SL
25// gdbg-check:$2 = {x = {6, 7, 8}, y = {{9, 10}, {11, 12}}}
26// gdbr-check:$2 = evec_in_struct::NoPadding2 {x: [6, 7, 8], y: [[9, 10], [11, 12]]}
1a4d82fc
JJ
27
28// gdb-command:print struct_internal_padding
c30ab7b3
SL
29// gdbg-check:$3 = {x = {13, 14}, y = {15, 16}}
30// gdbr-check:$3 = evec_in_struct::StructInternalPadding {x: [13, 14], y: [15, 16]}
1a4d82fc
JJ
31
32// gdb-command:print single_vec
c30ab7b3
SL
33// gdbg-check:$4 = {x = {17, 18, 19, 20, 21}}
34// gdbr-check:$4 = evec_in_struct::SingleVec {x: [17, 18, 19, 20, 21]}
1a4d82fc
JJ
35
36// gdb-command:print struct_padded_at_end
c30ab7b3
SL
37// gdbg-check:$5 = {x = {22, 23}, y = {24, 25}}
38// gdbr-check:$5 = evec_in_struct::StructPaddedAtEnd {x: [22, 23], y: [24, 25]}
1a4d82fc
JJ
39
40
41// === LLDB TESTS ==================================================================================
42
43// lldb-command:run
44
45// lldb-command:print no_padding1
0bf4aa26
XL
46// lldbg-check:[...]$0 = NoPadding1 { x: [0, 1, 2], y: -3, z: [4.5, 5.5] }
47// lldbr-check:(evec_in_struct::NoPadding1) no_padding1 = NoPadding1 { x: [0, 1, 2], y: -3, z: [4.5, 5.5] }
1a4d82fc 48// lldb-command:print no_padding2
0bf4aa26
XL
49// lldbg-check:[...]$1 = NoPadding2 { x: [6, 7, 8], y: [[9, 10], [11, 12]] }
50// lldbr-check:(evec_in_struct::NoPadding2) no_padding2 = NoPadding2 { x: [6, 7, 8], y: [[9, 10], [11, 12]] }
1a4d82fc
JJ
51
52// lldb-command:print struct_internal_padding
0bf4aa26
XL
53// lldbg-check:[...]$2 = StructInternalPadding { x: [13, 14], y: [15, 16] }
54// lldbr-check:(evec_in_struct::StructInternalPadding) struct_internal_padding = StructInternalPadding { x: [13, 14], y: [15, 16] }
1a4d82fc
JJ
55
56// lldb-command:print single_vec
0bf4aa26
XL
57// lldbg-check:[...]$3 = SingleVec { x: [17, 18, 19, 20, 21] }
58// lldbr-check:(evec_in_struct::SingleVec) single_vec = SingleVec { x: [17, 18, 19, 20, 21] }
1a4d82fc
JJ
59
60// lldb-command:print struct_padded_at_end
0bf4aa26
XL
61// lldbg-check:[...]$4 = StructPaddedAtEnd { x: [22, 23], y: [24, 25] }
62// lldbr-check:(evec_in_struct::StructPaddedAtEnd) struct_padded_at_end = StructPaddedAtEnd { x: [22, 23], y: [24, 25] }
1a4d82fc
JJ
63
64#![allow(unused_variables)]
b039eaaf 65#![feature(omit_gdb_pretty_printer_section)]
1a4d82fc
JJ
66#![omit_gdb_pretty_printer_section]
67
68struct NoPadding1 {
69 x: [u32; 3],
70 y: i32,
71 z: [f32; 2]
72}
73
74struct NoPadding2 {
75 x: [u32; 3],
76 y: [[u32; 2]; 2]
77}
78
79struct StructInternalPadding {
80 x: [i16; 2],
81 y: [i64; 2]
82}
83
84struct SingleVec {
85 x: [i16; 5]
86}
87
88struct StructPaddedAtEnd {
89 x: [i64; 2],
90 y: [i16; 2]
91}
92
93fn main() {
94
95 let no_padding1 = NoPadding1 {
96 x: [0, 1, 2],
97 y: -3,
98 z: [4.5, 5.5]
99 };
100
101 let no_padding2 = NoPadding2 {
102 x: [6, 7, 8],
103 y: [[9, 10], [11, 12]]
104 };
105
106 let struct_internal_padding = StructInternalPadding {
107 x: [13, 14],
108 y: [15, 16]
109 };
110
111 let single_vec = SingleVec {
112 x: [17, 18, 19, 20, 21]
113 };
114
115 let struct_padded_at_end = StructPaddedAtEnd {
116 x: [22, 23],
117 y: [24, 25]
118 };
119
120 zzz(); // #break
121}
122
123fn zzz() { () }