| 1 |
/* { dg-require-effective-target vect_int } */ |
| 2 |
|
| 3 |
#include "tree-vect.h" |
| 4 |
|
| 5 |
int a[1024]; |
| 6 |
|
| 7 |
void __attribute__((noipa)) |
| 8 |
foo(int k) |
| 9 |
{ |
| 10 |
int j = 5; |
| 11 |
for (int i = 0; i < 512; ++i) |
| 12 |
{ |
| 13 |
a[2*i] = j; |
| 14 |
a[2*i+1] = k; |
| 15 |
j++; |
| 16 |
k+=3; |
| 17 |
} |
| 18 |
} |
| 19 |
|
| 20 |
int |
| 21 |
main() |
| 22 |
{ |
| 23 |
check_vect (); |
| 24 |
|
| 25 |
foo (17); |
| 26 |
|
| 27 |
#pragma GCC novector |
| 28 |
for (int i = 0; i < 512; ++i) |
| 29 |
{ |
| 30 |
if (a[2*i] != 5 + i |
| 31 |
|| a[2*i+1] != 17 + 3 * i) |
| 32 |
__builtin_abort (); |
| 33 |
} |
| 34 |
|
| 35 |
return 0; |
| 36 |
} |
| 37 |
|
| 38 |
/* We don't yet support SLP inductions for variable length vectors. */ |
| 39 |
/* { dg-final { scan-tree-dump "vectorizing stmts using SLP" "vect" { xfail vect_variable_length } } } */ |
| 40 |
/* { dg-final { scan-tree-dump "Loop contains only SLP stmts" "vect" } } */ |