1 // { dg-require-effective-target size32plus }
2 // { dg-additional-options "-O2 -fopenmp -fdump-tree-vect-details" }
3 // { dg-additional-options "-msse2" { target sse2_runtime } }
4 // { dg-additional-options "-mavx" { target avx_runtime } }
5 // { dg-final { scan-tree-dump-times "vectorized \[2-6] loops" 2 "vect" { target sse2_runtime } } }
7 extern "C" void abort ();
14 inline S & operator= (const S &);
36 S<T>::operator= (const S &x)
49 S<int> r, a[1024], b[1024];
51 #pragma omp declare reduction (+: S<int>: omp_out.s += omp_in.s)
52 #pragma omp declare reduction (plus: S<int>: omp_out.s += omp_in.s) initializer (ini (omp_priv))
55 __attribute__((noipa)) void
56 foo (S<T> *a, S<T> *b)
58 #pragma omp for simd if (0) reduction (inscan, +:r)
59 for (int i = 0; i < 1024; i++)
62 #pragma omp scan exclusive(r)
68 __attribute__((noipa)) S<T>
73 #pragma omp for simd reduction (inscan, plus:s)
74 for (int i = 0; i < 1024; i++)
77 #pragma omp scan exclusive(s)
83 __attribute__((noipa)) void
84 baz (S<int> *a, S<int> *b)
86 #pragma omp parallel for simd reduction (inscan, +:r)
87 for (int i = 0; i < 1024; i++)
90 #pragma omp scan exclusive(r)
95 __attribute__((noipa)) S<int>
99 #pragma omp parallel for simd simdlen(1) reduction (inscan, plus:s)
100 for (int i = 0; i < 1024; i++)
103 #pragma omp scan exclusive(s)
113 for (int i = 0; i < 1024; ++i)
121 if (r.s != 1024 * 1023 / 2)
123 for (int i = 0; i < 1024; ++i)
131 if (bar<int> ().s != 1024 * 1023)
134 for (int i = 0; i < 1024; ++i)
142 if (r.s != 1024 * 1023 / 2)
145 for (int i = 0; i < 1024; ++i)
153 if (qux ().s != 1024 * 1023)
156 for (int i = 0; i < 1024; ++i)