2014-10-09 09:31:03 -05:00
// min-lldb-version: 310
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:run
2013-06-19 09:26:35 -05:00
2014-04-24 04:35:48 -05:00
// gdb-command:print three_simple_structs
2016-10-25 16:32:04 -05:00
// gdbg-check:$1 = {x = {x = 1}, y = {x = 2}, z = {x = 3}}
// gdbr-check:$1 = struct_in_struct::ThreeSimpleStructs {x: struct_in_struct::Simple {x: 1}, y: struct_in_struct::Simple {x: 2}, z: struct_in_struct::Simple {x: 3}}
2013-06-19 09:26:35 -05:00
2014-04-24 04:35:48 -05:00
// gdb-command:print internal_padding_parent
2016-10-25 16:32:04 -05:00
// gdbg-check:$2 = {x = {x = 4, y = 5}, y = {x = 6, y = 7}, z = {x = 8, y = 9}}
// gdbr-check:$2 = struct_in_struct::InternalPaddingParent {x: struct_in_struct::InternalPadding {x: 4, y: 5}, y: struct_in_struct::InternalPadding {x: 6, y: 7}, z: struct_in_struct::InternalPadding {x: 8, y: 9}}
2013-06-19 09:26:35 -05:00
2014-04-24 04:35:48 -05:00
// gdb-command:print padding_at_end_parent
2016-10-25 16:32:04 -05:00
// gdbg-check:$3 = {x = {x = 10, y = 11}, y = {x = 12, y = 13}, z = {x = 14, y = 15}}
// gdbr-check:$3 = struct_in_struct::PaddingAtEndParent {x: struct_in_struct::PaddingAtEnd {x: 10, y: 11}, y: struct_in_struct::PaddingAtEnd {x: 12, y: 13}, z: struct_in_struct::PaddingAtEnd {x: 14, y: 15}}
2013-06-19 09:26:35 -05:00
2014-07-09 07:46:09 -05:00
// === LLDB TESTS ==================================================================================
// lldb-command:run
// lldb-command:print three_simple_structs
2019-05-14 07:50:58 -05:00
// lldbg-check:[...]$0 = { x = { x = 1 } y = { x = 2 } z = { x = 3 } }
// lldbr-check:(struct_in_struct::ThreeSimpleStructs) three_simple_structs = { x = { x = 1 } y = { x = 2 } z = { x = 3 } }
2014-07-09 07:46:09 -05:00
// lldb-command:print internal_padding_parent
2019-05-14 07:50:58 -05:00
// lldbg-check:[...]$1 = { x = { x = 4 y = 5 } y = { x = 6 y = 7 } z = { x = 8 y = 9 } }
// lldbr-check:(struct_in_struct::InternalPaddingParent) internal_padding_parent = { x = { x = 4 y = 5 } y = { x = 6 y = 7 } z = { x = 8 y = 9 } }
2014-07-09 07:46:09 -05:00
// lldb-command:print padding_at_end_parent
2019-05-14 07:50:58 -05:00
// lldbg-check:[...]$2 = { x = { x = 10 y = 11 } y = { x = 12 y = 13 } z = { x = 14 y = 15 } }
// lldbr-check:(struct_in_struct::PaddingAtEndParent) padding_at_end_parent = { x = { x = 10 y = 11 } y = { x = 12 y = 13 } z = { x = 14 y = 15 } }
2014-07-09 07:46:09 -05:00
// lldb-command:print mixed
2019-05-14 07:50:58 -05:00
// lldbg-check:[...]$3 = { x = { x = 16 y = 17 } y = { x = 18 y = 19 } z = { x = 20 } w = 21 }
// lldbr-check:(struct_in_struct::Mixed) mixed = { x = { x = 16 y = 17 } y = { x = 18 y = 19 } z = { x = 20 } w = 21 }
2014-07-09 07:46:09 -05:00
// lldb-command:print bag
2019-05-14 07:50:58 -05:00
// lldbg-check:[...]$4 = { x = { x = 22 } }
// lldbr-check:(struct_in_struct::Bag) bag = { x = { x = 22 } }
2014-07-09 07:46:09 -05:00
// lldb-command:print bag_in_bag
2019-05-14 07:50:58 -05:00
// lldbg-check:[...]$5 = { x = { x = { x = 23 } } }
// lldbr-check:(struct_in_struct::BagInBag) bag_in_bag = { x = { x = { x = 23 } } }
2014-07-09 07:46:09 -05:00
// lldb-command:print tjo
2019-05-14 07:50:58 -05:00
// lldbg-check:[...]$6 = { x = { x = { x = { x = 24 } } } }
// lldbr-check:(struct_in_struct::ThatsJustOverkill) tjo = { x = { x = { x = { x = 24 } } } }
2014-07-09 07:46:09 -05:00
// lldb-command:print tree
2019-05-14 07:50:58 -05:00
// lldbg-check:[...]$7 = { x = { x = 25 } y = { x = { x = 26 y = 27 } y = { x = 28 y = 29 } z = { x = 30 y = 31 } } z = { x = { x = { x = 32 } } } }
// lldbr-check:(struct_in_struct::Tree) tree = { x = { x = 25 } y = { x = { x = 26 y = 27 } y = { x = 28 y = 29 } z = { x = 30 y = 31 } } z = { x = { x = { x = 32 } } } }
2014-07-09 07:46:09 -05:00
2014-10-27 17:37:07 -05:00
#![ allow(unused_variables) ]
2015-09-19 15:33:47 -05:00
#![ feature(omit_gdb_pretty_printer_section) ]
2014-12-03 16:48:18 -06:00
#![ omit_gdb_pretty_printer_section ]
2013-06-19 09:26:35 -05:00
struct Simple {
x : i32
}
struct InternalPadding {
x : i32 ,
y : i64
}
struct PaddingAtEnd {
x : i64 ,
y : i32
}
struct ThreeSimpleStructs {
x : Simple ,
y : Simple ,
z : Simple
}
struct InternalPaddingParent {
x : InternalPadding ,
y : InternalPadding ,
z : InternalPadding
}
struct PaddingAtEndParent {
x : PaddingAtEnd ,
y : PaddingAtEnd ,
2013-06-20 09:45:47 -05:00
z : PaddingAtEnd
2013-06-19 09:26:35 -05:00
}
struct Mixed {
x : PaddingAtEnd ,
y : InternalPadding ,
z : Simple ,
w : i16
}
struct Bag {
x : Simple
}
struct BagInBag {
x : Bag
}
struct ThatsJustOverkill {
x : BagInBag
}
struct Tree {
x : Simple ,
y : InternalPaddingParent ,
z : BagInBag
}
fn main ( ) {
2013-06-20 09:45:47 -05:00
2013-06-19 09:26:35 -05:00
let three_simple_structs = ThreeSimpleStructs {
x : Simple { x : 1 } ,
y : Simple { x : 2 } ,
z : Simple { x : 3 }
} ;
let internal_padding_parent = InternalPaddingParent {
x : InternalPadding { x : 4 , y : 5 } ,
y : InternalPadding { x : 6 , y : 7 } ,
z : InternalPadding { x : 8 , y : 9 }
} ;
let padding_at_end_parent = PaddingAtEndParent {
x : PaddingAtEnd { x : 10 , y : 11 } ,
y : PaddingAtEnd { x : 12 , y : 13 } ,
2013-06-20 09:45:47 -05:00
z : PaddingAtEnd { x : 14 , y : 15 }
2013-06-19 09:26:35 -05:00
} ;
let mixed = Mixed {
x : PaddingAtEnd { x : 16 , y : 17 } ,
y : InternalPadding { x : 18 , y : 19 } ,
z : Simple { x : 20 } ,
w : 21
} ;
let bag = Bag { x : Simple { x : 22 } } ;
2013-06-26 15:17:45 -05:00
let bag_in_bag = BagInBag {
x : Bag {
2013-06-20 09:45:47 -05:00
x : Simple { x : 23 }
}
2013-06-19 09:26:35 -05:00
} ;
2013-06-26 15:17:45 -05:00
let tjo = ThatsJustOverkill {
x : BagInBag {
x : Bag {
2013-06-20 09:45:47 -05:00
x : Simple { x : 24 }
}
2013-06-19 09:26:35 -05:00
}
} ;
let tree = Tree {
x : Simple { x : 25 } ,
2013-06-26 15:17:45 -05:00
y : InternalPaddingParent {
2013-06-19 09:26:35 -05:00
x : InternalPadding { x : 26 , y : 27 } ,
y : InternalPadding { x : 28 , y : 29 } ,
z : InternalPadding { x : 30 , y : 31 }
} ,
2013-06-26 15:17:45 -05:00
z : BagInBag {
x : Bag {
2013-06-20 09:45:47 -05:00
x : Simple { x : 32 }
}
2013-06-19 09:26:35 -05:00
}
} ;
2014-07-09 07:46:09 -05:00
zzz ( ) ; // #break
2013-06-19 09:26:35 -05:00
}
2013-08-17 10:37:42 -05:00
fn zzz ( ) { ( ) }