* gcc.target/i386/mpx/hard-reg-1-nov.c (mpx_test): Use "esp"
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr64421.c
blob3b5ab2d980c207c1d5e7fff73cd403ac38790080
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 } } */
6 #include "tree-vect.h"
8 #pragma omp declare simd linear (y) notinbranch
9 int foo (int x, int y) __asm ("bar");
11 #pragma omp declare simd linear (y) notinbranch
12 int
13 foo (int x, int y)
15 return x + y;
18 int a[1024] = { 1, 2 };
20 int
21 main ()
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 for (i = 2; i < 1024; i++)
31 if (a[i] != i)
32 abort ();
33 return 0;