Retro68/gcc/libgomp/testsuite/libgomp.c++/pr86539.C
Wolfgang Thaller 6fbf4226da gcc-9.1
2019-06-20 20:10:10 +02:00

29 lines
505 B
C

// PR middle-end/86539
int a[384];
__attribute__((noipa)) void
foo (int &b, int &c)
{
#pragma omp taskloop shared (a) collapse(3)
for (int i = 0; i < 1; i++)
for (int *p = &b; p < &c; p++)
for (int j = 0; j < 1; j++)
if (p < &a[128] || p >= &a[256])
__builtin_abort ();
else
p[0]++;
}
int
main ()
{
#pragma omp parallel
#pragma omp single
foo (a[128], a[256]);
for (int i = 0; i < 384; i++)
if (a[i] != (i >= 128 && i < 256))
__builtin_abort ();
return 0;
}