summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/appendix-a/a.26.2.c
blob: b655edc107c11e98469592508d5a16f83615d730 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do compile } */
/* { dg-options "-fopenmp -std=c99" } */

int a;
void
g (int k)
{
  a = k;			/* The global "a", not the private "a" in f */
}

void
f (int n)
{
  int a = 0;
#pragma omp parallel for private(a)
  for (int i = 1; i < n; i++)
    {
      a = i;
      g (a * 2);		/* Private copy of "a" */
    }
}