[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr109167.c
blobd490c995b141e96be09847abe25e01aef4b2c15a
1 /* { dg-do run } */
2 /* { dg-require-effective-target vsx_hw } */
3 /* { dg-options "-O2 -mvsx" } */
5 /* Verify there is no warning message. */
7 #define NO_WARN_X86_INTRINSICS 1
9 #include <emmintrin.h>
11 #define N 5
13 __attribute__ ((noipa)) __m128i
14 test1 (__m128i v)
16 return _mm_bslli_si128 (v, N);
19 __attribute__ ((noipa)) __m128i
20 test2 (__m128i v)
22 return _mm_slli_si128 (v, N);
25 typedef union
27 __m128i x;
28 unsigned char a[16];
29 } union128i_ub;
31 int main()
33 union128i_ub v;
34 v.x
35 = _mm_set_epi8 (1, 2, 3, 4, 10, 20, 30, 90, 80, 40, 100, 15, 98, 25, 98, 7);
37 union128i_ub r1, r2;
38 r1.x = test1 (v.x);
39 r2.x = test2 (v.x);
41 for (int i = 0; i < 16; i++)
42 if (r1.a[i] != r2.a[i])
43 __builtin_abort();
45 return 0;