aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c-c++-common/task-in-explicit-3.c
blob: 40eb94d4dca670be9059e24e50fa14ab1bd41c70 (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
/* { dg-do run } */

#include <omp.h>
#include <stdlib.h>

int a;

int
main ()
{
  #pragma omp task
  {
    if (!omp_in_explicit_task ())
      abort ();
    #pragma omp task
    {
      if (!omp_in_explicit_task ())
	abort ();
      #pragma omp taskgroup task_reduction (+: a)
      {
	if (!omp_in_explicit_task ())
	  abort ();
	#pragma omp task in_reduction (+: a)
	{
	  ++a;
	  if (!omp_in_explicit_task ())
	    abort ();
	}
      }
      if (!omp_in_explicit_task ())
	abort ();
      #pragma omp taskwait
    }
  }
  return 0;
}