blob: e5fc758d2834c1e8167d83b27dc46e4a3ca17d6c [file] [log] [blame]
#include <stdlib.h>
#include <unistd.h>
int
main ()
{
int x = 0, y = 0;
#pragma omp parallel shared(x, y)
#pragma omp master
{
#pragma omp task depend(out:y) shared(x, y)
{
sleep (1);
x = 1;
y = 1;
}
#pragma omp task depend(inout:y) shared(x, y)
{
if (x != 1 || y != 1)
abort ();
y++;
}
}
if (x != 1 || y != 2)
abort ();
x = 0;
y = 0;
#pragma omp parallel
#pragma omp master
{
#pragma omp task depend(out:y)
{
sleep (1);
x = 1;
y = 1;
}
#pragma omp task depend(inout:y)
{
if (x != 1 || y != 1)
abort ();
y++;
}
}
if (x != 1 || y != 2)
abort ();
return 0;
}