| 1 |
/* { dg-require-effective-target vect_int } */ |
| 2 |
|
| 3 |
#include <stdarg.h> |
| 4 |
#include "../../tree-vect.h" |
| 5 |
|
| 6 |
#define N 32 |
| 7 |
|
| 8 |
struct s{ |
| 9 |
int m; |
| 10 |
int n[N][N][N]; |
| 11 |
}; |
| 12 |
|
| 13 |
struct test1{ |
| 14 |
struct s a; /* array a.n is unaligned */ |
| 15 |
int b; |
| 16 |
int c; |
| 17 |
struct s e; /* array e.n is aligned */ |
| 18 |
}; |
| 19 |
|
| 20 |
int main1 () |
| 21 |
{ |
| 22 |
int i,j; |
| 23 |
struct test1 tmp1; |
| 24 |
|
| 25 |
/* 3. aligned */ |
| 26 |
for (i = 0; i < N; i++) |
| 27 |
{ |
| 28 |
tmp1.e.n[1][2][i] = 7; |
| 29 |
} |
| 30 |
|
| 31 |
/* check results: */ |
| 32 |
#pragma GCC novector |
| 33 |
for (i = 0; i < N; i++) |
| 34 |
{ |
| 35 |
if (tmp1.e.n[1][2][i] != 7) |
| 36 |
abort (); |
| 37 |
} |
| 38 |
|
| 39 |
return 0; |
| 40 |
} |
| 41 |
|
| 42 |
int main (void) |
| 43 |
{ |
| 44 |
check_vect (); |
| 45 |
|
| 46 |
return main1 (); |
| 47 |
} |
| 48 |
|
| 49 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ |