Update concepts branch to revision 131834
[official-gcc.git] / libgomp / testsuite / libgomp.c / icv-1.c
blob99708f82306bb5f76919a53bed2e79bc9d8adb88
1 #include <omp.h>
2 #include <stdlib.h>
4 int
5 main (void)
7 int err = 0;
9 omp_set_num_threads (4);
10 if (omp_get_max_threads () != 4)
11 abort ();
12 #pragma omp parallel reduction(|: err) num_threads(1)
14 if (omp_get_max_threads () != 4)
15 err |= 1;
16 omp_set_num_threads (6);
17 #pragma omp task if(0) shared(err)
19 if (omp_get_max_threads () != 6)
20 err |= 2;
21 omp_set_num_threads (5);
22 if (omp_get_max_threads () != 5)
23 err |= 4;
25 if (omp_get_max_threads () != 6)
26 err |= 8;
28 if (err)
29 abort ();
30 if (omp_get_max_threads () != 4)
31 abort ();
32 return 0;