| 1 |
/* { dg-add-options vect_early_break } */ |
| 2 |
/* { dg-require-effective-target vect_early_break_hw } */ |
| 3 |
/* { dg-require-effective-target vect_int } */ |
| 4 |
|
| 5 |
/* { dg-additional-options "-O3" } */ |
| 6 |
/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { ! "arm*-*-*" } } } } */ |
| 7 |
|
| 8 |
#include "tree-vect.h" |
| 9 |
|
| 10 |
double x[1024]; |
| 11 |
int a[1024]; |
| 12 |
double __attribute__((noipa)) foo () |
| 13 |
{ |
| 14 |
double sum = 0.0; |
| 15 |
for (int i = 0 ; i < 1023; ++i) |
| 16 |
{ |
| 17 |
sum += x[i]; |
| 18 |
if (a[i]) |
| 19 |
break; |
| 20 |
} |
| 21 |
return sum; |
| 22 |
} |
| 23 |
|
| 24 |
int main() |
| 25 |
{ |
| 26 |
check_vect (); |
| 27 |
|
| 28 |
for (int i = 0; i < 1024; ++i) |
| 29 |
x[i] = i; |
| 30 |
a[19] = 1; |
| 31 |
if (foo () != 190.) |
| 32 |
__builtin_abort (); |
| 33 |
return 0; |
| 34 |
} |