| 1 |
/* { dg-require-effective-target vect_int } */ |
| 2 |
/* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */ |
| 3 |
|
| 4 |
#include <stdarg.h> |
| 5 |
#include "tree-vect.h" |
| 6 |
|
| 7 |
#if VECTOR_BITS > 128 |
| 8 |
#define N (VECTOR_BITS / 8) |
| 9 |
#else |
| 10 |
#define N 16 |
| 11 |
#endif |
| 12 |
|
| 13 |
__attribute__ ((noinline)) |
| 14 |
int main1 () |
| 15 |
{ |
| 16 |
struct { |
| 17 |
char ca[N]; |
| 18 |
} s; |
| 19 |
int i; |
| 20 |
|
| 21 |
for (i = 0; i < N; i++) |
| 22 |
{ |
| 23 |
s.ca[i] = 5; |
| 24 |
} |
| 25 |
|
| 26 |
/* check results: */ |
| 27 |
#pragma GCC novector |
| 28 |
for (i = 0; i < N; i++) |
| 29 |
{ |
| 30 |
if (s.ca[i] != 5) |
| 31 |
abort (); |
| 32 |
} |
| 33 |
|
| 34 |
return 0; |
| 35 |
} |
| 36 |
|
| 37 |
int main (void) |
| 38 |
{ |
| 39 |
check_vect (); |
| 40 |
|
| 41 |
return main1 (); |
| 42 |
} |
| 43 |
|
| 44 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ |
| 45 |
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */ |
| 46 |
/* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */ |