with syntax fixes, this test case now appears to pass

This commit is contained in:
John Clements 2013-04-18 16:44:36 -07:00
parent cc4e0186ac
commit d6bb587c12

View File

@ -8,27 +8,25 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-test
tag a_tag<A> {
a_tag(A);
enum a_tag<A> {
a_tag(A)
}
type t_rec = {
struct t_rec {
c8: u8,
t: a_tag<u64>
};
fn mk_rec() -> t_rec {
return { c8:0u8, t:a_tag(0u64) };
}
fn is_8_byte_aligned(&&u: a_tag<u64>) -> bool {
fn mk_rec() -> t_rec {
return t_rec { c8:0u8, t:a_tag(0u64) };
}
fn is_8_byte_aligned(u: &a_tag<u64>) -> bool {
let p = ptr::to_unsafe_ptr(u) as uint;
return (p & 7u) == 0u;
}
pub fn main() {
let x = mk_rec();
assert!(is_8_byte_aligned(x.t));
assert!(is_8_byte_aligned(&x.t));
}