| 1 |
/* PR middle-end/64421 */ |
| 2 |
/* { dg-require-effective-target vect_simd_clones } */ |
| 3 |
/* { dg-additional-options "-fopenmp-simd" } */ |
| 4 |
/* { dg-additional-options "-mavx" { target avx_runtime } } */ |
| 5 |
|
| 6 |
#include "tree-vect.h" |
| 7 |
|
| 8 |
#pragma omp declare simd linear (y) notinbranch |
| 9 |
int foo (int x, int y) __asm ("bar"); |
| 10 |
|
| 11 |
#pragma omp declare simd linear (y) notinbranch |
| 12 |
int |
| 13 |
foo (int x, int y) |
| 14 |
{ |
| 15 |
return x + y; |
| 16 |
} |
| 17 |
|
| 18 |
int a[1024] = { 1, 2 }; |
| 19 |
|
| 20 |
int |
| 21 |
main () |
| 22 |
{ |
| 23 |
int i; |
| 24 |
check_vect (); |
| 25 |
#pragma omp simd |
| 26 |
for (i = 0; i < 1024; i++) |
| 27 |
a[i] = foo (a[i], i); |
| 28 |
if (a[0] != 1 || a[1] != 3) |
| 29 |
abort (); |
| 30 |
#pragma GCC novector |
| 31 |
for (i = 2; i < 1024; i++) |
| 32 |
if (a[i] != i) |
| 33 |
abort (); |
| 34 |
return 0; |
| 35 |
} |
| 36 |
|