summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c/pr49898-1.c
blob: 175426d4000d51cb250cf5d83abb0ed18dba2135 (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
/* PR middle-end/49898 */
/* { dg-do run } */

extern void abort (void);

int
main ()
{
  int i, j, sum = 0;
#pragma omp parallel
  {
  #pragma omp for reduction(+:sum)
    for (i = 0; i < 10; i++)
      {
      #pragma omp parallel
	{
	#pragma omp for reduction(+:sum)
	  for (j = 0; j < 10; j++)
	    sum += j;
	}
      }
  }
  if (sum != 450)
    abort ();
  return 0;
}