Rebase.
[official-gcc.git] / libgomp / testsuite / libgomp.c / omp-parallel-if.c
blob5e378359aacec79bf6516693d0627e7d602ec9aa
1 #include <omp.h>
3 extern void abort (void);
5 int
6 foo (void)
8 return 10;
11 main ()
13 int A = 0;
15 #pragma omp parallel if (foo () > 10) shared (A)
17 A = omp_get_num_threads ();
20 if (A != 1)
21 abort ();
23 #pragma omp parallel if (foo () == 10) num_threads (3) shared (A)
25 A = omp_get_num_threads ();
28 if (A != 3)
29 abort ();
31 #pragma omp parallel if (foo () == 10) num_threads (foo ()) shared (A)
33 A = omp_get_num_threads ();
36 if (A != 10)
37 abort ();
39 return 0;