summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c/pr36802-1.c
blob: 4ed5e12769b14980c171c5ccf874f4350ea7ec5a (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
/* PR middle-end/36802 */

extern void abort (void);

int
foo (int k)
{
  int i = 0;
#pragma omp parallel
  #pragma omp single
    {
      if (!k)
	{
	  int j;
	  for (j = 0; j < 10; j++)
	  #pragma omp task
	    if (j == 4)  
	      i++;
	}
      else
	i++;
    }
  return i;
}

int
main (void)
{
  if (foo (0) != 1)
    abort ();
  if (foo (1) != 1)
    abort ();
  return 0;
}