rust/src/test/run-pass/issue-2895.rs

24 lines
373 B
Rust
Raw Normal View History

2012-10-15 19:09:05 -05:00
use sys::size_of;
extern mod std;
struct Cat {
x: int
}
struct Kitty {
x: int,
drop {}
}
#[cfg(target_arch = "x86_64")]
2012-10-15 19:09:05 -05:00
fn main() {
assert (size_of::<Cat>() == 8 as uint);
assert (size_of::<Kitty>() == 16 as uint);
}
#[cfg(target_arch = "x86")]
fn main() {
assert (size_of::<Cat>() == 4 as uint);
assert (size_of::<Kitty>() == 8 as uint);
}