| 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 "-Ofast" } */ |
| 6 |
|
| 7 |
/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ |
| 8 |
|
| 9 |
#include "tree-vect.h" |
| 10 |
|
| 11 |
extern void abort (); |
| 12 |
|
| 13 |
int x; |
| 14 |
__attribute__ ((noinline, noipa)) |
| 15 |
void foo (int *a, int *b) |
| 16 |
{ |
| 17 |
int local_x = x; |
| 18 |
for (int i = 0; i < 1024; ++i) |
| 19 |
{ |
| 20 |
if (i + local_x == 13) |
| 21 |
break; |
| 22 |
a[i] = 2 * b[i]; |
| 23 |
} |
| 24 |
} |
| 25 |
|
| 26 |
int main () |
| 27 |
{ |
| 28 |
|
| 29 |
check_vect (); |
| 30 |
|
| 31 |
int a[1024] = {0}; |
| 32 |
int b[1024] = {0}; |
| 33 |
|
| 34 |
for (int i = 0; i < 1024; i++) |
| 35 |
b[i] = i; |
| 36 |
|
| 37 |
x = -512; |
| 38 |
foo (a, b); |
| 39 |
|
| 40 |
if (a[524] != 1048) |
| 41 |
abort (); |
| 42 |
|
| 43 |
if (a[525] != 0) |
| 44 |
abort (); |
| 45 |
|
| 46 |
if (a[1023] != 0) |
| 47 |
abort (); |
| 48 |
return 0; |
| 49 |
} |