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" } */
8 extern void abort (void);
11 doString(vector
unsigned short *vp
)
13 /* Iteration replaces tail recursion with -O2. */
14 vector
unsigned short result
= vec_strir (*vp
);
15 if (vec_strir_p (*vp
))
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, 0x0, 0xd, 0xe }
30 vector
unsigned short expected0
=
31 { 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
32 vector
unsigned short expected1
=
33 { 0x0, 0x0, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf };
34 vector
unsigned short expected2
=
35 { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
36 vector
unsigned short expected3
=
37 { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xd, 0xe };
39 if (!vec_all_eq (doString (&composed_string
[0]), expected1
))
41 if (!vec_all_eq (doString (&composed_string
[1]), expected1
))
43 if (!vec_all_eq (doString (&composed_string
[2]), expected2
))
45 if (!vec_all_eq (doString (&composed_string
[3]), expected3
))