[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / vec-extracth-5.c
blobc59dea03057e76ddc9ab2f9e5425696b8f4c8f6a
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, 16 };
17 vector unsigned long long int result_2 = { 0, 12 };
18 vector unsigned long long int result_3 = { 0, 4 };
19 vector unsigned long long int result_4 = { 0, 16 };
21 if (!vec_all_eq (vec_extracth (source_a, source_b, 12), result_1))
22 abort ();
23 if (!vec_all_eq (vec_extracth (source_a, source_b, 16), result_2))
24 abort ();
25 if (!vec_all_eq (vec_extracth (source_b, source_a, 8), result_3))
26 abort ();
27 if (!vec_all_eq (vec_extracth (source_b, source_a, 28), result_4))
28 abort ();
30 return 0;