1 // Copyright 2012-2015 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.
12 #![feature(intrinsics, main)]
15 extern "rust-intrinsic" {
16 pub fn pref_align_of<T>() -> usize;
17 pub fn min_align_of<T>() -> usize;
21 #[cfg(any(target_os = "linux",
23 target_os = "freebsd",
24 target_os = "dragonfly",
26 target_os = "openbsd"))]
29 #[cfg(target_arch = "x86")]
32 assert_eq!(::rusti::pref_align_of::<u64>(), 8);
33 assert_eq!(::rusti::min_align_of::<u64>(), 4);
38 #[cfg(any(target_arch = "x86_64", target_arch = "arm", target_arch = "aarch64"))]
41 assert_eq!(::rusti::pref_align_of::<u64>(), 8);
42 assert_eq!(::rusti::min_align_of::<u64>(), 8);
47 #[cfg(target_os = "bitrig")]
50 #[cfg(target_arch = "x86_64")]
53 assert_eq!(::rusti::pref_align_of::<u64>(), 8);
54 assert_eq!(::rusti::min_align_of::<u64>(), 8);
59 #[cfg(target_os = "windows")]
62 #[cfg(target_arch = "x86")]
65 assert_eq!(::rusti::pref_align_of::<u64>(), 8);
66 assert_eq!(::rusti::min_align_of::<u64>(), 8);
71 #[cfg(target_arch = "x86_64")]
74 assert_eq!(::rusti::pref_align_of::<u64>(), 8);
75 assert_eq!(::rusti::min_align_of::<u64>(), 8);
80 #[cfg(target_os = "android")]
83 #[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
86 assert_eq!(::rusti::pref_align_of::<u64>(), 8);
87 assert_eq!(::rusti::min_align_of::<u64>(), 8);