95782571f3
* gimplify.c (gimplify_adjust_omp_clauses_1): Handle GOVD_FIRSTPRIVATE | GOVD_LASTPRIVATE. (gimplify_adjust_omp_clauses): Simd region is never directly nested in combined parallel. Instead, for linear with copyin/copyout, if in combined for simd loop, make decl firstprivate/lastprivate on OMP_FOR. * omp-low.c (expand_omp_for_generic, expand_omp_for_static_nochunk, expand_omp_for_static_chunk): When setting endvar, also set fd->loop.v to the same value. libgomp/ * testsuite/libgomp.c/simd-10.c: New test. * testsuite/libgomp.c/simd-11.c: New test. * testsuite/libgomp.c/simd-12.c: New test. * testsuite/libgomp.c/simd-13.c: New test. From-SVN: r210009
27 lines
451 B
C
27 lines
451 B
C
/* { dg-do run } */
|
|
/* { dg-options "-O2" } */
|
|
/* { dg-additional-options "-msse2" { target sse2_runtime } } */
|
|
/* { dg-additional-options "-mavx" { target avx_runtime } } */
|
|
|
|
int s = 0, i, u;
|
|
|
|
void
|
|
foo ()
|
|
{
|
|
#pragma omp for simd schedule(static, 32) reduction(+:s) lastprivate(u)
|
|
for (i = 0; i < 128; i++)
|
|
{
|
|
s++;
|
|
u = i;
|
|
}
|
|
if (i != 128 || s != 128 || u != 127)
|
|
__builtin_abort ();
|
|
}
|
|
|
|
int
|
|
main ()
|
|
{
|
|
foo ();
|
|
return 0;
|
|
}
|