blob: 1993fe91b733c0a95dbee52b5473b5f65c0c5555 [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
Young-il Choica553172013-11-09 07:16:4411// xfail-android: FIXME(#10381)
sh8281.kim4e548282013-11-04 06:53:0112
Alex Crichton071ee962014-02-07 03:57:0913// compile-flags:-g
Michael Woeristera36e5372013-08-15 10:23:5414// debugger:set print pretty off
Michael Woerister93d63282013-09-06 14:00:0815// debugger:rbreak zzz
Michael Woeristera36e5372013-08-15 10:23:5416// debugger:run
17// debugger:finish
18
19// debugger:print no_padding16
20// check:$1 = {10000, -10001}
21
22// debugger:print no_padding32
23// check:$2 = {-10002, -10003.5, 10004}
24
25// debugger:print no_padding64
26// check:$3 = {-10005.5, 10006, 10007}
27
28// debugger:print no_padding163264
29// check:$4 = {-10008, 10009, 10010, 10011}
30
31// debugger:print internal_padding
32// check:$5 = {10012, -10013}
33
34// debugger:print padding_at_end
35// check:$6 = {-10014, 10015}
36
37
38// This test case mainly makes sure that no field names are generated for tuple structs (as opposed
Daniel Micay67a8ea52013-09-02 08:59:5139// to all fields having the name "<unnamed_field>"). Otherwise they are handled the same a normal
40// structs.
Michael Woeristera36e5372013-08-15 10:23:5441
42struct NoPadding16(u16, i16);
43struct NoPadding32(i32, f32, u32);
44struct NoPadding64(f64, i64, u64);
45struct NoPadding163264(i16, u16, i32, u64);
46struct InternalPadding(u16, i64);
47struct PaddingAtEnd(i64, u16);
48
49fn main() {
50 let no_padding16 = NoPadding16(10000, -10001);
51 let no_padding32 = NoPadding32(-10002, -10003.5, 10004);
52 let no_padding64 = NoPadding64(-10005.5, 10006, 10007);
53 let no_padding163264 = NoPadding163264(-10008, 10009, 10010, 10011);
54
55 let internal_padding = InternalPadding(10012, -10013);
56 let padding_at_end = PaddingAtEnd(-10014, 10015);
57
58 zzz();
59}
60
61fn zzz() {()}