| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-add-options vect_early_break } */ |
| 3 |
/* { dg-require-effective-target vect_early_break } */ |
| 4 |
/* { dg-require-effective-target vect_int } */ |
| 5 |
/* { dg-additional-options "-O3" } */ |
| 6 |
|
| 7 |
char string[1020] __attribute__((aligned(1))); |
| 8 |
|
| 9 |
char * find(int n, char c) |
| 10 |
{ |
| 11 |
for (int i = 0; i < n; i++) { |
| 12 |
if (string[i] == c) |
| 13 |
return &string[i]; |
| 14 |
} |
| 15 |
return 0; |
| 16 |
} |
| 17 |
|
| 18 |
/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ |
| 19 |
/* { dg-final { scan-tree-dump-not "Alignment of access forced using peeling" "vect" } } */ |
| 20 |
/* { dg-final { scan-tree-dump "force alignment of string" "vect" } } */ |