summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/sharing-2.c
blob: 33bbb3bade894c2c05bbbc2f3d8448e9955cc460 (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
/* { dg-do compile } */

void
foo (void)
{
  int i;
  int a[10];
  #pragma omp parallel private (i) shared (a)
  {
    i = 1;
    #pragma omp parallel shared (a, i)
    {
      #pragma omp master
	i = 2;
      #pragma omp parallel private (i) shared (a)
      {
	for (i = 0; i < 10; i++)
	  a[i] = i + 1;
      }
      #pragma omp master
	i = 3;
    }
    i = 4;
  }
}