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