* c-omp.c (c_omp_declare_simd_clauses_to_numbers): If all clauses
[official-gcc.git] / gcc / testsuite / g++.dg / vect / simd-clone-1.cc
blobf0be59aa60084477b81b93defaed3ddb5c27f832
1 // { dg-require-effective-target vect_simd_clones }
2 // { dg-additional-options "-fopenmp-simd -fno-inline" }
3 // { dg-additional-options "-mavx" { target avx_runtime } }
5 #include "../../gcc.dg/vect/tree-vect.h"
7 struct S
9 int s;
10 #pragma omp declare simd notinbranch linear(x)
11 int f (int x);
14 #pragma omp declare simd notinbranch linear(x)
15 int
16 S::f (int x)
18 return x;
21 template <int N>
22 struct T
24 int t;
25 #pragma omp declare simd notinbranch linear(x)
26 int f (int x);
29 #pragma omp declare simd notinbranch linear(x)
30 template <int N>
31 int
32 T<N>::f (int x)
34 return x;
37 void
38 do_main ()
40 int i, r = 0;
41 S s;
42 T<0> t;
43 #pragma omp simd reduction(+:r)
44 for (i = 0; i < 64; i++)
45 r += s.f (i) + t.f (i);
46 if (r != 64 * 63)
47 abort ();
50 int
51 main ()
53 check_vect ();
54 do_main ();