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" */ } }