1 // ensures that public symbols are not removed completely
3 // we can compile to a variety of platforms, because we don't need
4 // cross-compiled standard libraries.
5 #![feature(no_core, optin_builtin_traits)]
8 #![feature(repr_simd, simd_ffi, link_llvm_intrinsics, lang_items, rustc_attrs)]
14 pub struct f32x4(f32, f32, f32, f32);
18 #[link_name = "llvm.sqrt.v4f32"]
19 fn vsqrt(x: f32x4) -> f32x4;
22 pub fn foo(x: f32x4) -> f32x4 {
29 pub struct i32x4(i32, i32, i32, i32);
34 #[cfg(any(target_arch = "x86",
35 target_arch = "x86-64"))]
36 #[link_name = "llvm.x86.sse2.psll.d"]
37 fn integer(a: i32x4, b: i32x4) -> i32x4;
40 #[cfg(target_arch = "arm")]
41 #[link_name = "llvm.arm.neon.vmaxs.v4i32"]
42 fn integer(a: i32x4, b: i32x4) -> i32x4;
44 #[cfg(target_arch = "aarch64")]
45 #[link_name = "llvm.aarch64.neon.maxs.v4i32"]
46 fn integer(a: i32x4, b: i32x4) -> i32x4;
48 // just some substitute foreign symbol, not an LLVM intrinsic; so
49 // we still get type checking, but not as detailed as (ab)using
51 #[cfg(not(any(target_arch = "x86",
52 target_arch = "x86-64",
54 target_arch = "aarch64")))]
55 fn integer(a: i32x4, b: i32x4) -> i32x4;
58 pub fn bar(a: i32x4, b: i32x4) -> i32x4 {
59 unsafe {integer(a, b)}
79 #[rustc_builtin_macro]
80 macro_rules! Copy { () => () }