Update concepts branch to revision 131834
[official-gcc.git] / libgomp / testsuite / libgomp.c / pr35196.c
blobe92d9762931f4e52523ac88afd4af408a3092d97
1 /* PR middle-end/35196 */
2 /* { dg-do run } */
4 extern void abort (void);
5 extern void omp_set_dynamic (int);
7 int
8 main (void)
10 int i, j;
11 omp_set_dynamic (0);
12 #pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (static)
13 for (i = 0; i < 5; i++)
14 j = i;
15 if (i != 5 || j != 4)
16 abort ();
17 #pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (static, 2)
18 for (i = 0; i < 5; i++)
19 j = i;
20 if (i != 5 || j != 4)
21 abort ();
22 #pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (dynamic)
23 for (i = 0; i < 5; i++)
24 j = i;
25 if (i != 5 || j != 4)
26 abort ();
27 #pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (static)
28 for (i = -12; i < 21; i += 3)
29 j = i;
30 if (i != 21 || j != 18)
31 abort ();
32 #pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (static, 2)
33 for (i = -12; i < 21; i += 3)
34 j = i;
35 if (i != 21 || j != 18)
36 abort ();
37 #pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (dynamic, 3)
38 for (i = -12; i < 21; i += 3)
39 j = i;
40 if (i != 21 || j != 18)
41 abort ();
42 return 0;