[RS6000] Tests that use int128_t and -m32
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / vec-stril-21.c
blob07274c68307297381c65199befdab576e2ce1378
1 /* { dg-do run { target { power10_hw } } } */
2 /* { dg-do link { target { ! power10_hw } } } */
3 /* { dg-require-effective-target power10_ok } */
4 /* { dg-options "-O2 -mdejagnu-cpu=power10" } */
6 #include <altivec.h>
8 extern void abort (void);
10 vector unsigned short
11 doString(vector unsigned short *vp)
13 /* Iteration replaces tail recursion with -O2. */
14 vector unsigned short result = vec_stril (*vp);
15 if (vec_stril_p (*vp))
16 return result;
17 else
18 return doString (vp + 1);
21 int main (int argc, short *argv [])
23 vector unsigned short composed_string [4] = {
24 { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
25 { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf },
26 { 0x1, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 },
27 { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 }
30 vector unsigned short expected0 = { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
31 vector unsigned short expected1 = { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
32 vector unsigned short expected2 = { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
33 vector unsigned short expected3 = { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0 };
35 if (!vec_all_eq (doString (&composed_string[0]), expected1))
36 abort ();
37 if (!vec_all_eq (doString (&composed_string[1]), expected1))
38 abort ();
39 if (!vec_all_eq (doString (&composed_string[2]), expected2))
40 abort ();
41 if (!vec_all_eq (doString (&composed_string[3]), expected3))
42 abort ();