xfail scan-tree-dump-not throw in g++.dg/pr99966.C on hppa*64*-*-*
[official-gcc.git] / libgomp / testsuite / libgomp.c-c++-common / depend-mutexinout-1.c
blob86322eddbcc6ecae7e57db43b6e62f1382adc71b
1 int
2 main ()
4 int a, b, c, d;
5 #pragma omp parallel num_threads (6)
6 #pragma omp single
8 #pragma omp task depend(out: c)
9 c = 1;
10 #pragma omp task depend(out: a)
11 a = 2;
12 #pragma omp task depend(out: b)
13 b = 3;
14 /* The above 3 tasks can be scheduled in any order. */
15 #pragma omp task depend(in: a) depend(mutexinoutset: c)
16 c += a;
17 #pragma omp task depend(in: b) depend(mutexinoutset: c)
18 c += b;
19 /* The above 2 tasks are mutually exclusive and need to wait
20 for the first and second or first and third tasks respectively. */
21 #pragma omp task depend(in: c)
22 d = c;
23 /* The above task needs to wait for the mutexinoutset tasks. */
25 if (d != 6)
26 __builtin_abort ();
27 return 0;