[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / vec-strir-3.c
blobc266d3ac1330e3c47a900c04b571de7ba1e84c81
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 isolate right-justified on array of signed char. */
11 vector signed char
12 sirj (vector signed char arg)
14 return vec_strir (arg);
17 int main (int argc, char *argv [])
19 vector signed char input1 =
20 { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
21 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0xf, 0x11 };
22 vector signed char expected1 =
23 { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
24 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0xf, 0x11 };
25 vector signed char input2 =
26 { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
27 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0xf, 0x11 };
28 vector signed char expected2 =
29 { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
30 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0x11 };
31 vector signed char input3 =
32 { 0x1, 0x2, 0xf3, 0x0, 0x5, 0x6, 0x7, 0x8,
33 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 };
34 vector signed char expected3 =
35 { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
36 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11 };
37 vector signed char input4 =
38 { 0x1, 0x2, 0xf3, 0x4, 0x5, 0x6, 0x7, 0x8,
39 0x9, 0xa, 0xb, 0xc, 0xd, 0xe2, 0x0, 0x11 };
40 vector signed char expected4 =
41 { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
42 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11 };
44 if (!vec_all_eq (sirj (input1), expected1))
45 abort ();
46 if (!vec_all_eq (sirj (input2), expected2))
47 abort ();
48 if (!vec_all_eq (sirj (input3), expected3))
49 abort ();
50 if (!vec_all_eq (sirj (input4), expected4))
51 abort ();