Skip to content

Commit

Permalink
add alignment specific packed repr tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TannerRogalsky authored and dtolnay committed Jun 21, 2020
1 parent 1cd10a7 commit 7e5701a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test_suite/tests/test_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1893,4 +1893,16 @@ fn test_packed_struct_can_derive_serialize() {
struct CPacked {
t: f32,
}

#[derive(Copy, Clone, Serialize)]
#[repr(C, packed(2))]
struct CPacked2 {
t: f32,
}

#[derive(Copy, Clone, Serialize)]
#[repr(packed(2), C)]
struct Packed2C {
t: f32,
}
}

0 comments on commit 7e5701a

Please sign in to comment.