]> git.lizzy.rs Git - rust.git/blobdiff - src/test/compile-fail/simd-intrinsic-generic-elements.rs
Add #[rustc_no_mir] to make tests pass with -Z orbit.
[rust.git] / src / test / compile-fail / simd-intrinsic-generic-elements.rs
index ebe442c1a2e4dee05045f81fd997a1f864da7556..1f4cc72ffe717c2031de22da23096302aec09426 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(repr_simd, platform_intrinsics)]
+#![feature(repr_simd, platform_intrinsics, rustc_attrs)]
 
 #[repr(simd)]
 #[derive(Copy, Clone)]
@@ -56,33 +56,43 @@ struct f32x8(f32, f32, f32, f32,
     fn simd_shuffle8<T, U>(x: T, y: T, idx: [u32; 8]) -> U;
 }
 
+#[rustc_no_mir] // FIXME #27840 MIR doesn't provide precise spans for calls.
 fn main() {
     let x = i32x4(0, 0, 0, 0);
 
     unsafe {
         simd_insert(0, 0, 0);
-        //~^ ERROR SIMD insert intrinsic monomorphized for non-SIMD input type
+        //~^ ERROR expected SIMD input type, found non-SIMD `i32`
         simd_insert(x, 0, 1.0);
-        //~^ ERROR SIMD insert intrinsic monomorphized with inserted type not SIMD element type
+        //~^ ERROR expected inserted type `i32` (element of input `i32x4`), found `f64`
         simd_extract::<_, f32>(x, 0);
-        //~^ ERROR SIMD insert intrinsic monomorphized with returned type not SIMD element type
+        //~^ ERROR expected return type `i32` (element of input `i32x4`), found `f32`
 
         simd_shuffle2::<i32, i32>(0, 0, [0; 2]);
-        //~^ ERROR SIMD shuffle intrinsic monomorphized with non-SIMD input type
+        //~^ ERROR expected SIMD input type, found non-SIMD `i32`
         simd_shuffle3::<i32, i32>(0, 0, [0; 3]);
-        //~^ ERROR SIMD shuffle intrinsic monomorphized with non-SIMD input type
+        //~^ ERROR expected SIMD input type, found non-SIMD `i32`
         simd_shuffle4::<i32, i32>(0, 0, [0; 4]);
-        //~^ ERROR SIMD shuffle intrinsic monomorphized with non-SIMD input type
+        //~^ ERROR expected SIMD input type, found non-SIMD `i32`
         simd_shuffle8::<i32, i32>(0, 0, [0; 8]);
-        //~^ ERROR SIMD shuffle intrinsic monomorphized with non-SIMD input type
+        //~^ ERROR expected SIMD input type, found non-SIMD `i32`
 
         simd_shuffle2::<_, f32x2>(x, x, [0; 2]);
-        //~^ ERROR SIMD shuffle intrinsic monomorphized with different input and return element
+//~^ ERROR element type `i32` (element of input `i32x4`), found `f32x2` with element type `f32`
         simd_shuffle3::<_, f32x3>(x, x, [0; 3]);
-        //~^ ERROR SIMD shuffle intrinsic monomorphized with different input and return element
+//~^ ERROR element type `i32` (element of input `i32x4`), found `f32x3` with element type `f32`
         simd_shuffle4::<_, f32x4>(x, x, [0; 4]);
-        //~^ ERROR SIMD shuffle intrinsic monomorphized with different input and return element
+//~^ ERROR element type `i32` (element of input `i32x4`), found `f32x4` with element type `f32`
         simd_shuffle8::<_, f32x8>(x, x, [0; 8]);
-        //~^ ERROR SIMD shuffle intrinsic monomorphized with different input and return element
+//~^ ERROR element type `i32` (element of input `i32x4`), found `f32x8` with element type `f32`
+
+        simd_shuffle2::<_, i32x8>(x, x, [0; 2]);
+        //~^ ERROR expected return type of length 2, found `i32x8` with length 8
+        simd_shuffle3::<_, i32x4>(x, x, [0; 3]);
+        //~^ ERROR expected return type of length 3, found `i32x4` with length 4
+        simd_shuffle4::<_, i32x3>(x, x, [0; 4]);
+        //~^ ERROR expected return type of length 4, found `i32x3` with length 3
+        simd_shuffle8::<_, i32x2>(x, x, [0; 8]);
+        //~^ ERROR expected return type of length 8, found `i32x2` with length 2
     }
 }