Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/vec-stril_p-5.c

raw
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" } */
5
6 #include <altivec.h>
7
8 extern void abort (void);
9
10 /* Vector string isolate left-justified on array of unsigned short. */
11 int
12 silj_p (vector unsigned short arg)
13 {
14 return vec_stril_p (arg);
15 }
16
17 int main (int argc, short *argv [])
18 {
19 vector unsigned short input1 =
20 { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
21 vector unsigned short input2 =
22 { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
23 vector unsigned short input3 =
24 { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
25 vector unsigned short input4 =
26 { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
27
28 if (silj_p (input1))
29 abort ();
30 if (!silj_p (input2))
31 abort ();
32 if (!silj_p (input3))
33 abort ();
34 if (!silj_p (input4))
35 abort ();
36 }