]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/tag-align-u64.rs
rollup merge of #17355 : gamazeps/issue17210
[rust.git] / src / test / run-pass / tag-align-u64.rs
index ea60f389663cf5867480e5f80e62cfb21f6e9f9e..398a0939d97d7ce9827df24cf36f787fe8ed3700 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
 //
@@ -8,24 +8,27 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// xfail-test
+// ignore-linux #7340 fails on 32-bit Linux
+// ignore-macos #7340 fails on 32-bit macos
 
-enum a_tag {
-    a_tag(u64)
+use std::mem;
+
+enum Tag {
+    TagInner(u64)
 }
 
-struct t_rec {
+struct Rec {
     c8: u8,
-    t: a_tag
+    t: Tag
 }
 
-fn mk_rec() -> t_rec {
-    return t_rec { c8:0u8, t:a_tag(0u64) };
+fn mk_rec() -> Rec {
+    return Rec { c8:0u8, t:TagInner(0u64) };
 }
 
-fn is_8_byte_aligned(u: &a_tag) -> bool {
-    let p = ptr::to_unsafe_ptr(u) as u64;
-    return (p & 7u64) == 0u64;
+fn is_8_byte_aligned(u: &Tag) -> bool {
+    let p: uint = unsafe { mem::transmute(u) };
+    return (p & 7u) == 0u;
 }
 
 pub fn main() {