AVR: Assert minimal required bit width of section_common::flags.
[gcc.git] / libgomp / testsuite / libgomp.c / pr36802-3.c
blob700c2036f475b807ce2706455a7e8fe08f2d281d
1 /* PR middle-end/36802 */
3 extern void abort (void);
4 extern int omp_set_dynamic (int);
5 extern void omp_set_nested (int);
6 extern int omp_get_num_threads (void);
8 int q;
10 int
11 foo (int k)
13 int i = 6, n = 0;
14 omp_set_dynamic (0);
15 omp_set_nested (1);
16 #pragma omp parallel shared (i) num_threads (3)
18 int l;
20 if (omp_get_num_threads () != 3)
21 #pragma omp atomic
22 n += 1;
23 else
24 #pragma omp for
25 for (l = 0; l < 3; l++)
26 if (!k)
27 #pragma omp parallel shared (i) num_threads (4)
29 if (omp_get_num_threads () != 4)
30 #pragma omp atomic
31 n += 1;
32 #pragma omp critical
33 i += 1;
35 else
36 #pragma omp atomic
37 q += i;
39 if (n == 0 && i != 6 + 3 * 4)
40 abort ();
41 return 0;
44 int
45 main (void)
47 foo (0);
48 return 0;