[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / vec-clrl-3.c
blob0ae5abcee50603a116a6200ab49476813307202e
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 /* Vector string clear left-most bytes of unsigned char. */
11 vector signed char
12 clrl (vector signed char arg, int n)
14 return vec_clrl (arg, n);
17 int main (int argc, char *argv [])
19 vector signed char input0 =
20 { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
21 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
22 vector signed char expected0 =
23 { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24 0x0, 0x0, 0x0, 0xc, 0xd, 0xe, 0xf, 0x11 };
25 vector signed char expected1 =
26 { 0x0, 0x0, 0x0, 0x4, 0x5, 0x6, 0x7, 0x8,
27 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
28 vector signed char expected2 =
29 { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
30 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
32 if (!vec_all_eq (clrl (input0, 5), expected0))
33 abort ();
34 if (!vec_all_eq (clrl (input0, 13), expected1))
35 abort ();
36 if (!vec_all_eq (clrl (input0, 19), expected2))
37 abort ();