2009-04-01 08:54:52 +02:00
|
|
|
/* PR other/39591 */
|
|
|
|
/* { dg-do run } */
|
|
|
|
|
|
|
|
extern void abort (void);
|
|
|
|
|
2019-11-21 17:14:21 +01:00
|
|
|
int e;
|
2009-04-01 08:54:52 +02:00
|
|
|
|
|
|
|
int
|
|
|
|
main (void)
|
|
|
|
{
|
|
|
|
#pragma omp parallel
|
|
|
|
{
|
|
|
|
int array[40];
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < sizeof array / sizeof array[0]; i++)
|
|
|
|
array[i] = 0x55555555;
|
|
|
|
|
|
|
|
#pragma omp for schedule(dynamic)
|
|
|
|
for (i = 0; i < 50; i++)
|
|
|
|
#pragma omp task shared(array)
|
|
|
|
{
|
|
|
|
int j;
|
|
|
|
for (j = 0; j < sizeof array / sizeof array[0]; j++)
|
|
|
|
if (array[j] != 0x55555555)
|
|
|
|
#pragma omp atomic
|
2019-11-21 17:14:21 +01:00
|
|
|
e++;
|
2009-04-01 08:54:52 +02:00
|
|
|
}
|
|
|
|
}
|
2019-11-21 17:14:21 +01:00
|
|
|
if (e)
|
2009-04-01 08:54:52 +02:00
|
|
|
abort ();
|
|
|
|
return 0;
|
|
|
|
}
|