Retro68/gcc/libgomp/testsuite/libgomp.c/pr80809-1.c
2017-10-07 02:16:47 +02:00

30 lines
521 B
C

/* PR middle-end/80809 */
/* { dg-do run } */
__attribute__((noinline, noclone)) void
foo (int x)
{
int i, j, v[x], *w[16];
for (i = 0; i < x; i++)
v[i] = i;
#pragma omp parallel
#pragma omp single
for (i = 0; i < 16; i++)
/* Make sure v is implicitly determined shared in task, because it
is shared on the parallel. */
#pragma omp task private (j)
w[i] = v;
for (i = 0; i < 16; i++)
if (w[i] != v)
__builtin_abort ();
}
int
main ()
{
foo (4);
foo (27);
foo (196);
return 0;
}