1 /* This testcase violates the OpenMP requirements, as nested functions
2 access the original variables.
3 We test it just to make sure we don't ICE on it. */
4 /* { dg-do compile } */
5 /* { dg-options "-O2 -fopenmp" } */
7 extern void abort (void);
8 extern int omp_get_thread_num ();
9 extern void omp_set_dynamic (int);
14 int j = 0, k = 6, l = 7, m = 8;
20 return i + 1 + (j > 100 ? 10000 : 0);
22 #pragma omp sections private (i)
38 if (k != 6 || l != 7 || m != 8)
43 #pragma omp parallel num_threads (2) firstprivate (k) shared (l) private (m)
45 if (omp_get_thread_num () != 0)
46 k += omp_get_thread_num ();