debuginfo: Removed some test relying on data structure sizes hard to predict for all possible platforms and configurations.
This commit is contained in:
parent
b52eb4a0ff
commit
a1303cc815
@ -34,14 +34,6 @@
|
||||
// debugger:print sizeof(packedInPacked)
|
||||
// check:$6 = 40
|
||||
|
||||
// debugger:print sizeof(packedInUnpacked)
|
||||
// check:$7 = 48
|
||||
|
||||
// debugger:print sizeof(unpackedInPacked)
|
||||
// check:$8 = 58
|
||||
|
||||
|
||||
|
||||
#[packed]
|
||||
struct Packed {
|
||||
x: i16,
|
||||
@ -57,7 +49,7 @@ struct PackedInPacked {
|
||||
d: Packed
|
||||
}
|
||||
|
||||
// layout: aaaa bbbb bbbb bbbb bb.. .... cccc cccc dddd dddd dddd dd..
|
||||
// layout (64 bit): aaaa bbbb bbbb bbbb bb.. .... cccc cccc dddd dddd dddd dd..
|
||||
struct PackedInUnpacked {
|
||||
a: i32,
|
||||
b: Packed,
|
||||
@ -65,7 +57,7 @@ struct PackedInUnpacked {
|
||||
d: Packed
|
||||
}
|
||||
|
||||
// layout: xx.. yyyy zz.. .... wwww wwww
|
||||
// layout (64 bit): xx.. yyyy zz.. .... wwww wwww
|
||||
struct Unpacked {
|
||||
x: i16,
|
||||
y: i32,
|
||||
@ -73,7 +65,7 @@ struct Unpacked {
|
||||
w: i64
|
||||
}
|
||||
|
||||
// layout: aabb bbbb bbbb bbbb bbbb bbbb bbcc cccc cccc cccc cccc cccc ccdd dddd dd
|
||||
// layout (64 bit): aabb bbbb bbbb bbbb bbbb bbbb bbcc cccc cccc cccc cccc cccc ccdd dddd dd
|
||||
#[packed]
|
||||
struct UnpackedInPacked {
|
||||
a: i16,
|
||||
|
@ -26,10 +26,6 @@
|
||||
// debugger:print nested
|
||||
// check:$4 = {a = {a = {x = 7890, y = 9870}}}
|
||||
|
||||
// debugger:print sizeof(nested)
|
||||
// check:$5 = 32
|
||||
|
||||
|
||||
struct NoDestructor {
|
||||
x: i32,
|
||||
y: i64
|
||||
@ -84,6 +80,8 @@ fn main() {
|
||||
// then the debugger will have an invalid offset for the field 'guard' and thus should not be
|
||||
// able to read its value correctly (dots are padding bytes, D is the boolean destructor flag):
|
||||
//
|
||||
// 64 bit
|
||||
//
|
||||
// NoDestructorGuarded = 0000....00000000FFFFFFFF
|
||||
// <--------------><------>
|
||||
// NoDestructor guard
|
||||
@ -96,15 +94,29 @@ fn main() {
|
||||
// <----------------------><------> // How it actually is
|
||||
// WithDestructor guard
|
||||
//
|
||||
// 32 bit
|
||||
//
|
||||
// NoDestructorGuarded = 000000000000FFFFFFFF
|
||||
// <----------><------>
|
||||
// NoDestructor guard
|
||||
//
|
||||
//
|
||||
// withDestructorGuarded = 000000000000D...FFFFFFFF
|
||||
// <----------><------> // How debug info says it is
|
||||
// WithDestructor guard
|
||||
//
|
||||
// <--------------><------> // How it actually is
|
||||
// WithDestructor guard
|
||||
//
|
||||
let withDestructor = WithDestructorGuarded {
|
||||
a: WithDestructor { x: 10, y: 20 },
|
||||
guard: -1
|
||||
};
|
||||
|
||||
// expected layout = xxxx....yyyyyyyyD.......D...
|
||||
// <--WithDestructor------>
|
||||
// <-------NestedInner-------->
|
||||
// <-------NestedOuter-------->
|
||||
// expected layout (64 bit) = xxxx....yyyyyyyyD.......D...
|
||||
// <--WithDestructor------>
|
||||
// <-------NestedInner-------->
|
||||
// <-------NestedOuter-------->
|
||||
let nested = NestedOuter { a: NestedInner { a: WithDestructor { x: 7890, y: 9870 } } };
|
||||
|
||||
zzz();
|
||||
|
Loading…
x
Reference in New Issue
Block a user