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_stril (*vp
);
15 if (vec_stril_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, 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
))
37 if (!vec_all_eq (doString (&composed_string
[1]), expected1
))
39 if (!vec_all_eq (doString (&composed_string
[2]), expected2
))
41 if (!vec_all_eq (doString (&composed_string
[3]), expected3
))