1 /* { dg-require-effective-target vect_simd_clones } */ 2 /* { dg-additional-options "-fopenmp-simd" } */ 3 /* { dg-additional-options "-mavx" { target avx_runtime } } */ 4 5 #include "tree-vect.h" 6 7 #ifndef N 8 #define N 1024 9 #endif 10 11 int d[N], e[N]; 12 13 #pragma omp declare simd simdlen(4) notinbranch uniform(b) linear(c:3) 14 __attribute__((noinline)) long long int foo(int a,int b,int c)15foo (int a, int b, int c) 16 { 17 return a + b + c; 18 } 19 20 __attribute__((noinline, noclone)) void bar()21bar () 22 { 23 int i; 24 #pragma omp simd 25 for (i = 0; i < N; ++i) 26 { 27 d[i] = foo (i, 123, i * 3); 28 e[i] = e[i] + i; 29 } 30 } 31 32 int main()33main () 34 { 35 int i; 36 check_vect (); 37 bar (); 38 for (i = 0; i < N; i++) 39 if (d[i] != i * 4 + 123 || e[i] != i) 40 abort (); 41 return 0; 42 } 43 44