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 void abort (void);
8 int r
, a
[1024], b
[1024];
10 #pragma omp declare reduction (foo: int: omp_out += omp_in) initializer (omp_priv = 0)
12 __attribute__((noipa
)) void
15 #pragma omp for simd reduction (inscan, foo:r)
16 for (int i
= 0; i
< 1024; i
++)
19 #pragma omp scan exclusive(r)
24 __attribute__((noipa
)) int
29 #pragma omp for simd simdlen (1) reduction (inscan, foo:s)
30 for (int i
= 0; i
< 1024; i
++)
33 #pragma omp scan exclusive(s)
39 __attribute__((noipa
)) void
42 #pragma omp parallel for simd if (simd: 0) reduction (inscan, foo:r)
43 for (int i
= 0; i
< 1024; i
++)
46 #pragma omp scan exclusive(r)
51 __attribute__((noipa
)) int
55 #pragma omp parallel for simd reduction (inscan, foo:s)
56 for (int i
= 0; i
< 1024; i
++)
59 #pragma omp scan exclusive(s)
69 for (int i
= 0; i
< 1024; ++i
)
77 if (r
!= 1024 * 1023 / 2)
79 for (int i
= 0; i
< 1024; ++i
)
87 if (bar () != 1024 * 1023)
90 for (int i
= 0; i
< 1024; ++i
)
100 if (r
!= 1024 * 1023 / 2)
103 for (int i
= 0; i
< 1024; ++i
)
111 if (qux () != 1024 * 1023)
114 for (int i
= 0; i
< 1024; ++i
)