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 ();
8 int r, a[1024], b[1024], q;
10 template <typename T, typename U>
11 __attribute__((noipa)) void
14 #pragma omp for simd if (0) reduction (inscan, +:r)
15 for (int i = 0; i < 1024; i++)
18 #pragma omp scan exclusive(r)
24 __attribute__((noipa)) T
30 #pragma omp for simd reduction (inscan, +:s) simdlen(1)
31 for (int i = 0; i < 1024; i++)
34 #pragma omp scan exclusive(s)
41 __attribute__((noipa)) void
42 baz (T *a, T *b, T &r)
44 #pragma omp parallel for simd reduction (inscan, +:r)
45 for (T i = 0; i < 1024; i++)
48 #pragma omp scan exclusive(r)
54 __attribute__((noipa)) int
59 #pragma omp parallel for simd reduction (inscan, +:s)
60 for (int i = 0; i < 1024; i++)
63 #pragma omp scan exclusive(s)
73 for (int i = 0; i < 1024; ++i)
80 foo<int *, int &> (a, b, r);
81 if (r != 1024 * 1023 / 2)
83 for (int i = 0; i < 1024; ++i)
91 if (bar<int> () != 1024 * 1023)
94 for (int i = 0; i < 1024; ++i)
104 if (r != 1024 * 1023 / 2)
107 for (int i = 0; i < 1024; ++i)
115 if (qux<int &> () != 1024 * 1023)
118 for (int i = 0; i < 1024; ++i)