mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Add some repr(packed) tests
This commit is contained in:
parent
30e17e377c
commit
d17156a774
1 changed files with 30 additions and 0 deletions
|
@ -220,6 +220,36 @@ fn recursive() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn repr_packed() {
|
||||||
|
size_and_align! {
|
||||||
|
#[repr(packed)]
|
||||||
|
struct Goal;
|
||||||
|
}
|
||||||
|
size_and_align! {
|
||||||
|
#[repr(packed(2))]
|
||||||
|
struct Goal;
|
||||||
|
}
|
||||||
|
size_and_align! {
|
||||||
|
#[repr(packed(4))]
|
||||||
|
struct Goal;
|
||||||
|
}
|
||||||
|
size_and_align! {
|
||||||
|
#[repr(packed)]
|
||||||
|
struct Goal(i32);
|
||||||
|
}
|
||||||
|
size_and_align! {
|
||||||
|
#[repr(packed(2))]
|
||||||
|
struct Goal(i32);
|
||||||
|
}
|
||||||
|
size_and_align! {
|
||||||
|
#[repr(packed(4))]
|
||||||
|
struct Goal(i32);
|
||||||
|
}
|
||||||
|
|
||||||
|
check_size_and_align("#[repr(packed(5))] struct Goal(i32);", "", 4, 1);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn generic() {
|
fn generic() {
|
||||||
size_and_align! {
|
size_and_align! {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue