Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/debuginfo/associated-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ impl TraitWithAssocType for i32 {
fn get_value(&self) -> i64 { *self as i64 }
}

#[repr(C)]
struct Struct<T: TraitWithAssocType> {
b: T,
b1: T::Type,
Expand Down
2 changes: 2 additions & 0 deletions tests/debuginfo/boxed-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@

#![allow(unused_variables)]

#[repr(C)]
struct StructWithSomePadding {
x: i16,
y: i32,
z: i32,
w: i64
}

#[repr(C)]
struct StructWithDestructor {
x: i16,
y: i32,
Expand Down
6 changes: 5 additions & 1 deletion tests/debuginfo/c-style-enum-in-composite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,21 @@
use self::AnEnum::{OneHundred, OneThousand, OneMillion};
use self::AnotherEnum::{MountainView, Toronto, Vienna};

#[repr(u32)]
enum AnEnum {
OneHundred = 100,
OneThousand = 1000,
OneMillion = 1000000
}

#[repr(u8)]
enum AnotherEnum {
MountainView,
Toronto,
Vienna
}

#[repr(C)]
struct PaddedStruct {
a: i16,
b: AnEnum,
Expand All @@ -77,7 +80,7 @@ struct PaddedStruct {
e: i16
}

#[repr(packed)]
#[repr(C, packed)]
struct PackedStruct {
a: i16,
b: AnEnum,
Expand All @@ -86,6 +89,7 @@ struct PackedStruct {
e: i16
}

#[repr(C)]
struct NonPaddedStruct {
a: AnEnum,
b: AnotherEnum,
Expand Down
3 changes: 3 additions & 0 deletions tests/debuginfo/destructured-for-loop-variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
// === LLDB TESTS ==================================================================================

//@ lldb-command:type format add --format hex char
// MSVC uses signed char
//@ lldb-command:type format add --format hex 'signed char'
//@ lldb-command:type format add --format hex 'unsigned char'

//@ lldb-command:run
Expand Down Expand Up @@ -144,6 +146,7 @@
#![allow(unused_variables)]
#![feature(deref_patterns)]

#[repr(C)]
struct Struct {
x: i16,
y: f32,
Expand Down
4 changes: 4 additions & 0 deletions tests/debuginfo/evec-in-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,20 @@

#![allow(unused_variables)]

#[repr(C)]
struct NoPadding1 {
x: [u32; 3],
y: i32,
z: [f32; 2]
}

#[repr(C)]
struct NoPadding2 {
x: [u32; 3],
y: [[u32; 2]; 2]
}

#[repr(C)]
struct StructInternalPadding {
x: [i16; 2],
y: [i64; 2]
Expand All @@ -61,6 +64,7 @@ struct SingleVec {
x: [i16; 5]
}

#[repr(C)]
struct StructPaddedAtEnd {
x: [i64; 2],
y: [i16; 2]
Expand Down
14 changes: 9 additions & 5 deletions tests/debuginfo/packed-struct-with-destructor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

#![allow(unused_variables)]

#[repr(packed)]
#[repr(C, packed)]
struct Packed {
x: i16,
y: i32,
Expand All @@ -74,21 +74,23 @@ impl Drop for Packed {
fn drop(&mut self) {}
}

#[repr(packed)]
#[repr(C, packed)]
struct PackedInPacked {
a: i32,
b: Packed,
c: i64,
d: Packed
}

#[repr(C)]
struct PackedInUnpacked {
a: i32,
b: Packed,
c: i64,
d: Packed
}

#[repr(C)]
struct Unpacked {
x: i64,
y: i32,
Expand All @@ -99,15 +101,15 @@ impl Drop for Unpacked {
fn drop(&mut self) {}
}

#[repr(packed)]
#[repr(C, packed)]
struct UnpackedInPacked {
a: i16,
b: Unpacked,
c: Unpacked,
d: i64
}

#[repr(packed)]
#[repr(C, packed)]
struct PackedInPackedWithDrop {
a: i32,
b: Packed,
Expand All @@ -119,6 +121,7 @@ impl Drop for PackedInPackedWithDrop {
fn drop(&mut self) {}
}

#[repr(C)]
struct PackedInUnpackedWithDrop {
a: i32,
b: Packed,
Expand All @@ -130,7 +133,7 @@ impl Drop for PackedInUnpackedWithDrop {
fn drop(&mut self) {}
}

#[repr(packed)]
#[repr(C, packed)]
struct UnpackedInPackedWithDrop {
a: i16,
b: Unpacked,
Expand All @@ -142,6 +145,7 @@ impl Drop for UnpackedInPackedWithDrop {
fn drop(&mut self) {}
}

#[repr(C)]
struct DeeplyNested {
a: PackedInPacked,
b: UnpackedInPackedWithDrop,
Expand Down
8 changes: 5 additions & 3 deletions tests/debuginfo/packed-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,22 @@

#![allow(unused_variables)]

#[repr(packed)]
#[repr(C, packed)]
struct Packed {
x: i16,
y: i32,
z: i64
}

#[repr(packed)]
#[repr(C, packed)]
struct PackedInPacked {
a: i32,
b: Packed,
c: i64,
d: Packed
}

#[repr(C)]
// layout (64 bit): aaaa bbbb bbbb bbbb bb.. .... cccc cccc dddd dddd dddd dd..
struct PackedInUnpacked {
a: i32,
Expand All @@ -72,6 +73,7 @@ struct PackedInUnpacked {
d: Packed
}

#[repr(C)]
// layout (64 bit): xx.. yyyy zz.. .... wwww wwww
struct Unpacked {
x: i16,
Expand All @@ -81,7 +83,7 @@ struct Unpacked {
}

// layout (64 bit): aabb bbbb bbbb bbbb bbbb bbbb bbcc cccc cccc cccc cccc cccc ccdd dddd dd
#[repr(packed)]
#[repr(C, packed)]
struct UnpackedInPacked {
a: i16,
b: Unpacked,
Expand Down
6 changes: 6 additions & 0 deletions tests/debuginfo/simple-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,35 +87,41 @@
#![allow(unused_variables)]
#![allow(dead_code)]

#[repr(C)]
struct NoPadding16 {
x: u16,
y: i16
}

#[repr(C)]
struct NoPadding32 {
x: i32,
y: f32,
z: u32
}

#[repr(C)]
struct NoPadding64 {
x: f64,
y: i64,
z: u64
}

#[repr(C)]
struct NoPadding163264 {
a: i16,
b: u16,
c: i32,
d: u64
}

#[repr(C)]
struct InternalPadding {
x: u16,
y: i64
}

#[repr(C)]
struct PaddingAtEnd {
x: i64,
y: u16
Expand Down
7 changes: 7 additions & 0 deletions tests/debuginfo/struct-in-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,34 +50,40 @@ struct Simple {
x: i32
}

#[repr(C)]
struct InternalPadding {
x: i32,
y: i64
}

#[repr(C)]
struct PaddingAtEnd {
x: i64,
y: i32
}

#[repr(C)]
struct ThreeSimpleStructs {
x: Simple,
y: Simple,
z: Simple
}

#[repr(C)]
struct InternalPaddingParent {
x: InternalPadding,
y: InternalPadding,
z: InternalPadding
}

#[repr(C)]
struct PaddingAtEndParent {
x: PaddingAtEnd,
y: PaddingAtEnd,
z: PaddingAtEnd
}

#[repr(C)]
struct Mixed {
x: PaddingAtEnd,
y: InternalPadding,
Expand All @@ -97,6 +103,7 @@ struct ThatsJustOverkill {
x: BagInBag
}

#[repr(C)]
struct Tree {
x: Simple,
y: InternalPaddingParent,
Expand Down
4 changes: 4 additions & 0 deletions tests/debuginfo/struct-with-destructor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@

#![allow(unused_variables)]

#[repr(C)]
struct NoDestructor {
x: i32,
y: i64
}

#[repr(C)]
struct WithDestructor {
x: i32,
y: i64
Expand All @@ -49,11 +51,13 @@ impl Drop for WithDestructor {
fn drop(&mut self) {}
}

#[repr(C)]
struct NoDestructorGuarded {
a: NoDestructor,
guard: i64
}

#[repr(C)]
struct WithDestructorGuarded {
a: WithDestructor,
guard: i64
Expand Down
1 change: 1 addition & 0 deletions tests/debuginfo/vec-slices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@

#![allow(dead_code, unused_variables)]

#[repr(C)]
struct AStruct {
x: i16,
y: i32,
Expand Down
Loading