[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / altivec-34.c
blob98fa5d2d4191ae3c74b8d0f82480ed28a8796898
1 /* PR target/49621 */
2 /* { dg-do compile } */
3 /* { dg-require-effective-target powerpc_altivec_ok } */
4 /* { dg-options "-O2 -maltivec -mno-vsx" } */
6 #include <altivec.h>
8 int
9 foo (void)
11 vector unsigned a, b, c;
12 unsigned k = 1;
14 a = (vector unsigned) { 0, 0, 0, 1 };
15 b = c = (vector unsigned) { 0, 0, 0, 0 };
17 a = vec_add (a, vec_splats (k));
18 b = vec_add (b, a);
19 c = vec_sel (c, a, b);
21 if (vec_any_eq (b, c))
22 return 1;
24 return 0;