blob: b15237127608545c8ada030354ad055810bf1f58 (
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
45
|
/* { dg-do run } */
#include <omp.h>
#include <stdlib.h>
int err;
int
main ()
{
int e;
#pragma omp parallel shared(err)
{
if (omp_in_final ())
#pragma omp atomic write
err = 1;
#pragma omp task if (0) shared(err)
{
if (omp_in_final ())
#pragma omp atomic write
err = 1;
#pragma omp task if (0) shared(err)
if (omp_in_final ())
#pragma omp atomic write
err = 1;
}
#pragma omp task final (1) shared(err)
{
if (!omp_in_final ())
#pragma omp atomic write
err = 1;
#pragma omp taskyield
#pragma omp taskwait
#pragma omp task shared(err)
if (!omp_in_final ())
#pragma omp atomic write
err = 1;
}
}
#pragma omp atomic read
e = err;
if (e)
abort ();
return 0;
}
|