| 1 |
/* { dg-require-effective-target vect_int } */ |
| 2 |
#include "tree-vect.h" |
| 3 |
|
| 4 |
#define N 20 |
| 5 |
int u[N] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19}; |
| 6 |
int z[N] = {-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18}; |
| 7 |
int res4[N] = {0, 1, 8, 3, 22, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19}; |
| 8 |
int res5[N] = {0, 1, 8, 3, 22, 5, 36, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19}; |
| 9 |
int res6[N] = {0, 1, 8, 3, 22, 5, 36, 7, 50, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19}; |
| 10 |
int res7[N] = {0, 1, 8, 3, 22, 5, 36, 7, 50, 9, 64, 11, 12, 13, 14, 15, 16, 17, 18, 19}; |
| 11 |
int res8[N] = {0, 1, 8, 3, 22, 5, 36, 7, 50, 9, 64, 11, 78, 13, 14, 15, 16, 17, 18, 19}; |
| 12 |
int res9[N] = {0, 1, 8, 3, 22, 5, 36, 7, 50, 9, 64, 11, 78, 13, 92, 15, 16, 17, 18, 19}; |
| 13 |
int res10[N] = {0, 1, 8, 3, 22, 5, 36, 7, 50, 9, 64, 11, 78, 13, 92, 15, 106, 17, 18, 19}; |
| 14 |
|
| 15 |
__attribute__ ((noinline)) void |
| 16 |
foo (int n, int d) |
| 17 |
{ |
| 18 |
int i; |
| 19 |
for (i = 2; i < n; i++) |
| 20 |
u[2*i-2] = u[2*i-2] + d * (z[i-1] + z[i] + z[i-1] + z[i] + z[i-1] + z[i]); |
| 21 |
} |
| 22 |
|
| 23 |
#define check_u(x) \ |
| 24 |
foo (x, 2); \ |
| 25 |
_Pragma("GCC novector") \ |
| 26 |
for (i = 0; i < N; i++) \ |
| 27 |
{ \ |
| 28 |
if (u[i] != res##x[i]) \ |
| 29 |
abort (); \ |
| 30 |
u[i] = i; \ |
| 31 |
} |
| 32 |
|
| 33 |
int main(void) |
| 34 |
{ |
| 35 |
int i; |
| 36 |
|
| 37 |
check_vect (); |
| 38 |
|
| 39 |
/* Need to check for all possible vector factors. */ |
| 40 |
check_u(4); |
| 41 |
check_u(5); |
| 42 |
check_u(6); |
| 43 |
check_u(7); |
| 44 |
check_u(8); |
| 45 |
check_u(9); |
| 46 |
check_u(10); |
| 47 |
|
| 48 |
return 0; |
| 49 |
} |