1 // RUN: %libomp-compile-and-run
3 #include "omp_testsuite.h"
5 int test_omp_parallel_num_threads()
14 /* first we check how many threads are available */
18 max_threads
= omp_get_num_threads ();
21 /* we increase the number of threads from one to maximum:*/
22 for(threads
= 1; threads
<= max_threads
; threads
++) {
24 #pragma omp parallel reduction(+:num_failed) num_threads(threads)
26 num_failed
= num_failed
+ !(threads
== omp_get_num_threads());
30 num_failed
= num_failed
+ !(nthreads
== threads
);
40 for(i
= 0; i
< REPETITIONS
; i
++) {
41 if(!test_omp_parallel_num_threads()) {