3 // Test that the simd_bitmask intrinsic produces ok-ish error
4 // messages when misused.
6 #![feature(repr_simd, platform_intrinsics)]
7 #![allow(non_camel_case_types)]
10 #[derive(Copy, Clone)]
11 pub struct u32x2([u32; 2]);
14 #[derive(Copy, Clone)]
15 pub struct u32x4([u32; 4]);
18 #[derive(Copy, Clone)]
22 #[derive(Copy, Clone)]
23 struct u8x16([u8; 16]);
26 #[derive(Copy, Clone)]
27 struct u8x32([u8; 32]);
30 #[derive(Copy, Clone)]
31 struct u8x64([u8; 64]);
33 extern "platform-intrinsic" {
34 fn simd_bitmask<T, U>(x: T) -> U;
38 let m2 = u32x2([0; 2]);
39 let m4 = u32x4([0; 4]);
40 let m8 = u8x8([0; 8]);
41 let m16 = u8x16([0; 16]);
42 let m32 = u8x32([0; 32]);
43 let m64 = u8x64([0; 64]);
46 let _: u8 = simd_bitmask(m2);
47 let _: u8 = simd_bitmask(m4);
48 let _: u8 = simd_bitmask(m8);
49 let _: u16 = simd_bitmask(m16);
50 let _: u32 = simd_bitmask(m32);
51 let _: u64 = simd_bitmask(m64);
53 let _: u16 = simd_bitmask(m2);
54 //~^ ERROR invalid monomorphization of `simd_bitmask` intrinsic
56 let _: u16 = simd_bitmask(m8);
57 //~^ ERROR invalid monomorphization of `simd_bitmask` intrinsic
59 let _: u32 = simd_bitmask(m16);
60 //~^ ERROR invalid monomorphization of `simd_bitmask` intrinsic
62 let _: u64 = simd_bitmask(m32);
63 //~^ ERROR invalid monomorphization of `simd_bitmask` intrinsic
65 let _: u128 = simd_bitmask(m64);
66 //~^ ERROR invalid monomorphization of `simd_bitmask` intrinsic