mirror of
https://github.com/autc04/Retro68.git
synced 2024-11-30 19:53:46 +00:00
45 lines
792 B
C++
45 lines
792 B
C++
|
// { 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 ();
|
||
|
}
|