1 // RUN: %libomp-compile-and-run
3 #include "omp_testsuite.h"
6 #pragma omp threadprivate(myit)
8 #pragma omp threadprivate(myresult)
10 int test_omp_single_private()
12 int nr_threads_in_single
;
18 nr_threads_in_single
= 0;
22 #pragma omp parallel private(i)
26 for (i
= 0; i
< LOOPCOUNT
; i
++) {
27 #pragma omp single private(nr_threads_in_single) nowait
29 nr_threads_in_single
= 0;
31 nr_threads_in_single
++;
34 myresult
= myresult
+ nr_threads_in_single
;
39 result
+= nr_threads_in_single
;
40 nr_iterations
+= myit
;
43 return ((result
== 0) && (nr_iterations
== LOOPCOUNT
));
44 } /* end of check_single private */
51 for(i
= 0; i
< REPETITIONS
; i
++) {
52 if(!test_omp_single_private()) {