1 /* { dg-require-effective-target size32plus } */
2 /* { dg-additional-options "-fopenmp-simd" } */
3 /* { dg-additional-options "-mavx" { target avx_runtime } } */
4 /* { dg-final { scan-tree-dump-times "vectorized \[1-3] loops" 2 "vect" { target i?86-*-* x86_64-*-* } } } */
10 int r
, a
[1024], b
[1024];
12 #pragma omp declare reduction (foo: int: omp_out += omp_in) initializer (omp_priv = 0)
14 __attribute__((noipa
)) void
17 #pragma omp simd reduction (inscan, foo:r)
18 for (int i
= 0; i
< 1024; i
++)
21 #pragma omp scan inclusive(r)
26 __attribute__((noipa
)) int
30 #pragma omp simd reduction (inscan, foo:s)
31 for (int i
= 0; i
< 1024; i
++)
34 #pragma omp scan inclusive(s)
40 __attribute__((noipa
)) void
43 #pragma omp simd reduction (inscan, foo:r) if (simd: 0)
44 for (int i
= 0; i
< 1024; i
++)
47 #pragma omp scan inclusive(r)
52 __attribute__((noipa
)) int
56 #pragma omp simd reduction (inscan, foo:s) simdlen (1)
57 for (int i
= 0; i
< 1024; i
++)
60 #pragma omp scan inclusive(s)
73 for (int i
= 0; i
< 1024; ++i
)
80 if (r
!= 1024 * 1023 / 2)
83 for (int i
= 0; i
< 1024; ++i
)
91 if (bar () != 1024 * 1023)
95 for (int i
= 0; i
< 1024; ++i
)
105 if (r
!= 1024 * 1023 / 2)
109 for (int i
= 0; i
< 1024; ++i
)
117 if (qux () != 1024 * 1023)
121 for (int i
= 0; i
< 1024; ++i
)