ca2b131143
* gimplify.c (omp_is_private): Don't return true if decl is not already private on #pragma omp for or #pragma omp parallel for. * gcc.dg/gomp/pr27388-3.c: Adjust dg-final. * testsuite/libgomp.c/loop-10.c: New test. * libgomp.c/loop-3.c (main): Add lastprivate clause. * libgomp.c++/loop-6.C (main): Likewise. From-SVN: r137199
31 lines
585 B
C
31 lines
585 B
C
extern void abort (void);
|
|
|
|
int i = 8;
|
|
|
|
int main (void)
|
|
{
|
|
int j = 7, k = 0;
|
|
#pragma omp for
|
|
for (i = 0; i < 10; i++)
|
|
;
|
|
#pragma omp for
|
|
for (j = 0; j < 10; j++)
|
|
;
|
|
/* OpenMP 3.0 newly guarantees that the original list items can't
|
|
be shared with the privatized omp for iterators, even when
|
|
the original list items are already private. */
|
|
if (i != 8 || j != 7)
|
|
abort ();
|
|
#pragma omp parallel private (i) reduction (+:k)
|
|
{
|
|
i = 6;
|
|
#pragma omp for
|
|
for (i = 0; i < 10; i++)
|
|
;
|
|
k = (i != 6);
|
|
}
|
|
if (k)
|
|
abort ();
|
|
return 0;
|
|
}
|