blob: 762b8dcb38f45585205b9571e7343810fda1f6f5 [file] [log] [blame]
Michael Woeristera36e5372013-08-15 10:23:541// Copyright 2013 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
Michael Woeristera36e5372013-08-15 10:23:5411// compile-flags:-Z extra-debug-info
12// debugger:set print pretty off
13// debugger:break zzz
14// debugger:run
15// debugger:finish
16
17// debugger:print no_padding16
18// check:$1 = {10000, -10001}
19
20// debugger:print no_padding32
21// check:$2 = {-10002, -10003.5, 10004}
22
23// debugger:print no_padding64
24// check:$3 = {-10005.5, 10006, 10007}
25
26// debugger:print no_padding163264
27// check:$4 = {-10008, 10009, 10010, 10011}
28
29// debugger:print internal_padding
30// check:$5 = {10012, -10013}
31
32// debugger:print padding_at_end
33// check:$6 = {-10014, 10015}
34
35
36// This test case mainly makes sure that no field names are generated for tuple structs (as opposed
Daniel Micay67a8ea52013-09-02 08:59:5137// to all fields having the name "<unnamed_field>"). Otherwise they are handled the same a normal
38// structs.
Michael Woeristera36e5372013-08-15 10:23:5439
40struct NoPadding16(u16, i16);
41struct NoPadding32(i32, f32, u32);
42struct NoPadding64(f64, i64, u64);
43struct NoPadding163264(i16, u16, i32, u64);
44struct InternalPadding(u16, i64);
45struct PaddingAtEnd(i64, u16);
46
47fn main() {
48 let no_padding16 = NoPadding16(10000, -10001);
49 let no_padding32 = NoPadding32(-10002, -10003.5, 10004);
50 let no_padding64 = NoPadding64(-10005.5, 10006, 10007);
51 let no_padding163264 = NoPadding163264(-10008, 10009, 10010, 10011);
52
53 let internal_padding = InternalPadding(10012, -10013);
54 let padding_at_end = PaddingAtEnd(-10014, 10015);
55
56 zzz();
57}
58
59fn zzz() {()}