2014-02-07 13:08:32 -06:00
|
|
|
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
|
2013-08-15 05:23:54 -05:00
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2014-02-07 13:08:32 -06:00
|
|
|
// ignore-android: FIXME(#10381)
|
2013-11-04 00:53:01 -06:00
|
|
|
|
2014-02-06 21:57:09 -06:00
|
|
|
// compile-flags:-g
|
2014-07-09 07:46:09 -05:00
|
|
|
|
|
|
|
// === GDB TESTS ===================================================================================
|
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:set print pretty off
|
|
|
|
// gdb-command:rbreak zzz
|
|
|
|
// gdb-command:run
|
|
|
|
// gdb-command:finish
|
2013-08-15 05:23:54 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print no_padding16
|
|
|
|
// gdb-check:$1 = {10000, -10001}
|
2013-08-15 05:23:54 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print no_padding32
|
|
|
|
// gdb-check:$2 = {-10002, -10003.5, 10004}
|
2013-08-15 05:23:54 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print no_padding64
|
|
|
|
// gdb-check:$3 = {-10005.5, 10006, 10007}
|
2013-08-15 05:23:54 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print no_padding163264
|
|
|
|
// gdb-check:$4 = {-10008, 10009, 10010, 10011}
|
2013-08-15 05:23:54 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print internal_padding
|
|
|
|
// gdb-check:$5 = {10012, -10013}
|
2013-08-15 05:23:54 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print padding_at_end
|
|
|
|
// gdb-check:$6 = {-10014, 10015}
|
2013-08-15 05:23:54 -05:00
|
|
|
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
// === LLDB TESTS ==================================================================================
|
|
|
|
|
|
|
|
// lldb-command:run
|
|
|
|
|
|
|
|
// lldb-command:print no_padding16
|
|
|
|
// lldb-check:[...]$0 = NoPadding16(10000, -10001)
|
|
|
|
|
|
|
|
// lldb-command:print no_padding32
|
|
|
|
// lldb-check:[...]$1 = NoPadding32(-10002, -10003.5, 10004)
|
|
|
|
|
|
|
|
// lldb-command:print no_padding64
|
|
|
|
// lldb-check:[...]$2 = NoPadding64(-10005.5, 10006, 10007)
|
|
|
|
|
|
|
|
// lldb-command:print no_padding163264
|
|
|
|
// lldb-check:[...]$3 = NoPadding163264(-10008, 10009, 10010, 10011)
|
|
|
|
|
|
|
|
// lldb-command:print internal_padding
|
|
|
|
// lldb-check:[...]$4 = InternalPadding(10012, -10013)
|
|
|
|
|
|
|
|
// lldb-command:print padding_at_end
|
|
|
|
// lldb-check:[...]$5 = PaddingAtEnd(-10014, 10015)
|
|
|
|
|
2013-08-15 05:23:54 -05:00
|
|
|
// This test case mainly makes sure that no field names are generated for tuple structs (as opposed
|
2013-09-02 03:59:51 -05:00
|
|
|
// to all fields having the name "<unnamed_field>"). Otherwise they are handled the same a normal
|
|
|
|
// structs.
|
2013-08-15 05:23:54 -05:00
|
|
|
|
|
|
|
struct NoPadding16(u16, i16);
|
|
|
|
struct NoPadding32(i32, f32, u32);
|
|
|
|
struct NoPadding64(f64, i64, u64);
|
|
|
|
struct NoPadding163264(i16, u16, i32, u64);
|
|
|
|
struct InternalPadding(u16, i64);
|
|
|
|
struct PaddingAtEnd(i64, u16);
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let no_padding16 = NoPadding16(10000, -10001);
|
|
|
|
let no_padding32 = NoPadding32(-10002, -10003.5, 10004);
|
|
|
|
let no_padding64 = NoPadding64(-10005.5, 10006, 10007);
|
|
|
|
let no_padding163264 = NoPadding163264(-10008, 10009, 10010, 10011);
|
|
|
|
|
|
|
|
let internal_padding = InternalPadding(10012, -10013);
|
|
|
|
let padding_at_end = PaddingAtEnd(-10014, 10015);
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2013-08-15 05:23:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn zzz() {()}
|