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