blob: b523c4d225352a3440293f28cc4a0904158746ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
// { dg-do run }
#include <omp.h>
#include <cstdlib>
int errval;
int
main ()
{
int e;
#pragma omp parallel shared(errval)
{
if (omp_in_final ())
#pragma omp atomic write
errval = 1;
#pragma omp task if (0) shared(errval)
{
if (omp_in_final ())
#pragma omp atomic write
errval = 1;
#pragma omp task if (0) shared(errval)
if (omp_in_final ())
#pragma omp atomic write
errval = 1;
}
#pragma omp task final (1) shared(errval)
{
if (!omp_in_final ())
#pragma omp atomic write
errval = 1;
#pragma omp taskyield
#pragma omp taskwait
#pragma omp task shared(errval)
if (!omp_in_final ())
#pragma omp atomic write
errval = 1;
}
}
#pragma omp atomic read
e = errval;
if (e)
abort ();
}
|