Retro68/gcc/libgomp/testsuite/libgomp.c-c++-common/taskwait-depend-1.c
Wolfgang Thaller 6fbf4226da gcc-9.1
2019-06-20 20:10:10 +02:00

30 lines
533 B
C

#ifdef __cplusplus
extern "C"
#endif
void abort (void);
int
main ()
{
int a, b, c, d;
#pragma omp parallel num_threads (4)
#pragma omp single
{
#pragma omp task depend(out : a)
a = 6;
#pragma omp task depend(out : b)
b = 7;
#pragma omp task depend(out : c)
c = 8;
#pragma omp taskwait depend(in : a, c)
d = a + c;
#pragma omp task depend(out : a)
a = 9;
#pragma omp task depend(out : c)
c = 10;
}
if (a != 9 || b != 7 || c != 10 || d != 6 + 8)
abort ();
return 0;
}