2018-08-30 12:18:55 +00:00
|
|
|
//@ run-pass
|
2013-05-06 14:35:27 +00:00
|
|
|
//@ aux-build:packed.rs
|
|
|
|
|
2015-03-22 20:13:15 +00:00
|
|
|
|
2014-02-14 18:10:06 +00:00
|
|
|
extern crate packed;
|
2013-05-06 14:35:27 +00:00
|
|
|
|
2013-10-17 01:34:01 +00:00
|
|
|
use std::mem;
|
2013-05-25 02:35:29 +00:00
|
|
|
|
2018-02-04 11:10:28 +00: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 23:30:54 +00:00
|
|
|
pub fn main() {
|
2018-02-04 11:10:28 +00:00
|
|
|
check!(packed::P1S5, 1, 5);
|
|
|
|
check!(packed::P2S6, 2, 6);
|
|
|
|
check!(packed::P2CS8, 2, 8);
|
2013-05-06 14:35:27 +00:00
|
|
|
}
|