2014-10-09 14:31:03 +00:00
|
|
|
//@ min-lldb-version: 310
|
2013-11-04 06:53:01 +00:00
|
|
|
|
2014-02-07 03:57:09 +00:00
|
|
|
//@ compile-flags:-g
|
2014-07-09 12:46:09 +00:00
|
|
|
|
|
|
|
// === GDB TESTS ===================================================================================
|
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:run
|
2013-08-15 10:23:54 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print no_padding16
|
2016-10-25 21:32:04 +00:00
|
|
|
// gdbg-check:$1 = {__0 = 10000, __1 = -10001}
|
|
|
|
// gdbr-check:$1 = tuple_struct::NoPadding16 (10000, -10001)
|
2013-08-15 10:23:54 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print no_padding32
|
2016-10-25 21:32:04 +00:00
|
|
|
// gdbg-check:$2 = {__0 = -10002, __1 = -10003.5, __2 = 10004}
|
|
|
|
// gdbr-check:$2 = tuple_struct::NoPadding32 (-10002, -10003.5, 10004)
|
2013-08-15 10:23:54 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print no_padding64
|
2016-10-25 21:32:04 +00:00
|
|
|
// gdbg-check:$3 = {__0 = -10005.5, __1 = 10006, __2 = 10007}
|
|
|
|
// gdbr-check:$3 = tuple_struct::NoPadding64 (-10005.5, 10006, 10007)
|
2013-08-15 10:23:54 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print no_padding163264
|
2016-10-25 21:32:04 +00:00
|
|
|
// gdbg-check:$4 = {__0 = -10008, __1 = 10009, __2 = 10010, __3 = 10011}
|
|
|
|
// gdbr-check:$4 = tuple_struct::NoPadding163264 (-10008, 10009, 10010, 10011)
|
2013-08-15 10:23:54 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print internal_padding
|
2016-10-25 21:32:04 +00:00
|
|
|
// gdbg-check:$5 = {__0 = 10012, __1 = -10013}
|
|
|
|
// gdbr-check:$5 = tuple_struct::InternalPadding (10012, -10013)
|
2013-08-15 10:23:54 +00:00
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
// gdb-command:print padding_at_end
|
2016-10-25 21:32:04 +00:00
|
|
|
// gdbg-check:$6 = {__0 = -10014, __1 = 10015}
|
|
|
|
// gdbr-check:$6 = tuple_struct::PaddingAtEnd (-10014, 10015)
|
2013-08-15 10:23:54 +00:00
|
|
|
|
|
|
|
|
2014-07-09 12:46:09 +00:00
|
|
|
// === LLDB TESTS ==================================================================================
|
|
|
|
|
|
|
|
// lldb-command:run
|
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v no_padding16
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] { 0 = 10000 1 = -10001 }
|
2019-05-14 12:50:58 +00:00
|
|
|
// lldbr-check:(tuple_struct::NoPadding16) no_padding16 = { 0 = 10000 1 = -10001 }
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v no_padding32
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] { 0 = -10002 1 = -10003.5 2 = 10004 }
|
2019-05-14 12:50:58 +00:00
|
|
|
// lldbr-check:(tuple_struct::NoPadding32) no_padding32 = { 0 = -10002 1 = -10003.5 2 = 10004 }
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v no_padding64
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] { 0 = -10005.5 1 = 10006 2 = 10007 }
|
2019-05-14 12:50:58 +00:00
|
|
|
// lldbr-check:(tuple_struct::NoPadding64) no_padding64 = { 0 = -10005.5 1 = 10006 2 = 10007 }
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v no_padding163264
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] { 0 = -10008 1 = 10009 2 = 10010 3 = 10011 }
|
2019-05-14 12:50:58 +00:00
|
|
|
// lldbr-check:(tuple_struct::NoPadding163264) no_padding163264 = { 0 = -10008 1 = 10009 2 = 10010 3 = 10011 }
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v internal_padding
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] { 0 = 10012 1 = -10013 }
|
2019-05-14 12:50:58 +00:00
|
|
|
// lldbr-check:(tuple_struct::InternalPadding) internal_padding = { 0 = 10012 1 = -10013 }
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2024-03-15 14:05:57 +00:00
|
|
|
// lldb-command:v padding_at_end
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldbg-check:[...] { 0 = -10014 1 = 10015 }
|
2019-05-14 12:50:58 +00:00
|
|
|
// lldbr-check:(tuple_struct::PaddingAtEnd) padding_at_end = { 0 = -10014 1 = 10015 }
|
2014-07-09 12:46:09 +00:00
|
|
|
|
2013-08-15 10:23:54 +00:00
|
|
|
// This test case mainly makes sure that no field names are generated for tuple structs (as opposed
|
2013-09-02 08:59:51 +00:00
|
|
|
// to all fields having the name "<unnamed_field>"). Otherwise they are handled the same a normal
|
|
|
|
// structs.
|
2013-08-15 10:23:54 +00:00
|
|
|
|
2014-12-03 22:48:18 +00:00
|
|
|
|
2015-09-19 20:33:47 +00:00
|
|
|
#![feature(omit_gdb_pretty_printer_section)]
|
2014-12-03 22:48:18 +00:00
|
|
|
#![omit_gdb_pretty_printer_section]
|
|
|
|
|
2013-08-15 10:23:54 +00: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 12:46:09 +00:00
|
|
|
zzz(); // #break
|
2013-08-15 10:23:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn zzz() {()}
|