| 1 |
#include "tree-vect.h" |
| 2 |
|
| 3 |
int a[1024]; |
| 4 |
int b[1024]; |
| 5 |
|
| 6 |
int |
| 7 |
foo () |
| 8 |
{ |
| 9 |
int tem; |
| 10 |
for (int i = 0; i < 1024; ++i) |
| 11 |
{ |
| 12 |
if (a[i] < 0) |
| 13 |
tem = -a[i] - 1; |
| 14 |
else |
| 15 |
tem = a[i]; |
| 16 |
b[i] = tem + 10; |
| 17 |
} |
| 18 |
return tem; |
| 19 |
} |
| 20 |
|
| 21 |
int main() |
| 22 |
{ |
| 23 |
check_vect (); |
| 24 |
|
| 25 |
for (int i = 0; i < 1024; ++i) |
| 26 |
{ |
| 27 |
a[i] = i - 333; |
| 28 |
__asm__ volatile ("" ::: "memory"); |
| 29 |
} |
| 30 |
int res = foo (); |
| 31 |
if (res != 1023 - 333) |
| 32 |
abort (); |
| 33 |
return 0; |
| 34 |
} |
| 35 |
|
| 36 |
/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target vect_condition } } } */ |