[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / vec-extractl-5.c
blobe642e3144e0e65a75f748d3eed43931453bf507d
1 /* { dg-do run { target { power10_hw } } } */
2 /* { dg-do link { target { ! power10_hw } } } */
3 /* { dg-require-effective-target power10_ok } */
4 /* { dg-options "-mdejagnu-cpu=power10" } */
6 #include <altivec.h>
8 extern void abort (void);
10 int
11 main (int argc, char *argv [])
13 vector unsigned int source_a = { 0, 4, 8, 12 };
14 vector unsigned int source_b = { 16, 20, 24, 28 };
16 vector unsigned long long int result_1 = { 0, 12 };
17 vector unsigned long long int result_2 = { 0, 16 };
18 vector unsigned long long int result_3 = { 0, 24 };
19 vector unsigned long long int result_4 = { 0, 4 };
21 if (!vec_all_eq (vec_extractl (source_a, source_b, 12), result_1))
22 abort ();
23 if (!vec_all_eq (vec_extractl (source_a, source_b, 16), result_2))
24 abort ();
25 if (!vec_all_eq (vec_extractl (source_b, source_a, 8), result_3))
26 abort ();
27 if (!vec_all_eq (vec_extractl (source_b, source_a, 20), result_4))
28 abort ();
30 return 0;