| 1 |
/* { dg-require-effective-target vect_int } */ |
| 2 |
/* { dg-require-effective-target vect_condition } */ |
| 3 |
#include <stdarg.h> |
| 4 |
#include "tree-vect.h" |
| 5 |
|
| 6 |
#define N 256 |
| 7 |
int a[N] = {0}; |
| 8 |
|
| 9 |
__attribute__ ((noinline)) |
| 10 |
int foo () |
| 11 |
{ |
| 12 |
int i, res = 0; |
| 13 |
for (i = 0; i < N; i++) |
| 14 |
{ |
| 15 |
if (a[i] != 0) |
| 16 |
res = 1; |
| 17 |
} |
| 18 |
return res; |
| 19 |
} |
| 20 |
|
| 21 |
int main (void) |
| 22 |
{ |
| 23 |
int i, res; |
| 24 |
|
| 25 |
check_vect (); |
| 26 |
|
| 27 |
if ((res = foo ()) != 0) |
| 28 |
abort (); |
| 29 |
|
| 30 |
a[34] = 101; |
| 31 |
a[85] = 9; |
| 32 |
if ((res = foo ()) != 1) |
| 33 |
abort (); |
| 34 |
|
| 35 |
return 0; |
| 36 |
} |
| 37 |
/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */ |