| 1 |
/* This checks that vectorized constructors have the correct ordering. */ |
| 2 |
/* { dg-require-effective-target vect_int } */ |
| 3 |
|
| 4 |
typedef int V __attribute__((__vector_size__(16))); |
| 5 |
|
| 6 |
__attribute__((__noipa__)) void |
| 7 |
foo (unsigned int x, V *y) |
| 8 |
{ |
| 9 |
unsigned int a[4] = { x + 0, x + 2, x + 4, x + 6 }; |
| 10 |
for (unsigned int i = 0; i < 3; ++i) |
| 11 |
if (a[i] == 1234) |
| 12 |
a[i]--; |
| 13 |
*y = (V) { a[3], a[2], a[1], a[0] }; |
| 14 |
} |
| 15 |
|
| 16 |
int |
| 17 |
main () |
| 18 |
{ |
| 19 |
V b; |
| 20 |
foo (0, &b); |
| 21 |
if (b[0] != 6 || b[1] != 4 || b[2] != 2 || b[3] != 0) |
| 22 |
__builtin_abort (); |
| 23 |
return 0; |
| 24 |
} |
| 25 |
|
| 26 |
/* See that we try to vectorize an SLP instance. */ |
| 27 |
/* { dg-final { scan-tree-dump "Analyzing vectorizable constructor" "slp1" } } */ |