1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 #![feature(intrinsics)]
14 extern "rust-intrinsic" {
15 pub fn pref_align_of<T>() -> uint;
16 pub fn min_align_of<T>() -> uint;
20 #[cfg(target_os = "linux")]
21 #[cfg(target_os = "macos")]
22 #[cfg(target_os = "freebsd")]
23 #[cfg(target_os = "dragonfly")]
26 #[cfg(target_arch = "x86")]
29 assert_eq!(::rusti::pref_align_of::<u64>(), 8u);
30 assert_eq!(::rusti::min_align_of::<u64>(), 4u);
35 #[cfg(target_arch = "x86_64")]
38 assert_eq!(::rusti::pref_align_of::<u64>(), 8u);
39 assert_eq!(::rusti::min_align_of::<u64>(), 8u);
44 #[cfg(target_os = "win32")]
47 #[cfg(target_arch = "x86")]
50 assert_eq!(::rusti::pref_align_of::<u64>(), 8u);
51 assert_eq!(::rusti::min_align_of::<u64>(), 8u);
56 #[cfg(target_os = "android")]
59 #[cfg(target_arch = "arm")]
62 assert_eq!(::rusti::pref_align_of::<u64>(), 8u);
63 assert_eq!(::rusti::min_align_of::<u64>(), 8u);