2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2013-05-06 23:35:27 +09:00
|
|
|
// aux-build:packed.rs
|
|
|
|
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2014-02-14 10:10:06 -08:00
|
|
|
extern crate packed;
|
2013-05-06 23:35:27 +09:00
|
|
|
|
2013-10-16 18:34:01 -07:00
|
|
|
use std::mem;
|
2013-05-24 19:35:29 -07:00
|
|
|
|
2018-02-04 22:10:28 +11:00
|
|
|
macro_rules! check {
|
|
|
|
($t:ty, $align:expr, $size:expr) => ({
|
|
|
|
assert_eq!(mem::align_of::<$t>(), $align);
|
|
|
|
assert_eq!(mem::size_of::<$t>(), $size);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2014-01-03 15:30:54 -08:00
|
|
|
pub fn main() {
|
2018-02-04 22:10:28 +11:00
|
|
|
check!(packed::P1S5, 1, 5);
|
|
|
|
check!(packed::P2S6, 2, 6);
|
|
|
|
check!(packed::P2CS8, 2, 8);
|
2013-05-06 23:35:27 +09:00
|
|
|
}
|