2012-10-15 19:09:05 -05:00
|
|
|
use sys::size_of;
|
|
|
|
extern mod std;
|
|
|
|
|
|
|
|
struct Cat {
|
|
|
|
x: int
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Kitty {
|
|
|
|
x: int,
|
2012-11-14 00:22:37 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Kitty : Drop {
|
2012-11-28 17:42:16 -06:00
|
|
|
fn finalize(&self) {}
|
2012-10-15 19:09:05 -05:00
|
|
|
}
|
|
|
|
|
2012-10-20 16:52:31 -05:00
|
|
|
#[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);
|
|
|
|
}
|
2012-10-20 16:52:31 -05:00
|
|
|
|
|
|
|
#[cfg(target_arch = "x86")]
|
|
|
|
fn main() {
|
|
|
|
assert (size_of::<Cat>() == 4 as uint);
|
|
|
|
assert (size_of::<Kitty>() == 8 as uint);
|
|
|
|
}
|