1 // RUN: %libomp-compile-and-run
2 #include "omp_testsuite.h"
7 #pragma omp threadprivate(j)
9 int test_omp_single_copyprivate()
16 #pragma omp parallel num_threads(4)
19 for (i
= 0; i
< LOOPCOUNT
; i
++)
23 thread
= omp_get_thread_num ();
25 #pragma omp single copyprivate(j)
30 printf ("thread %d assigns, j = %d, i = %d\n", thread
, j
, i
);
39 printf ("thread = %d, j = %d, i = %d\n", thread
, j
, i
);
41 result
= result
+ j
- i
;
45 } /* end of parallel */
46 return ((result
== 0) && (nr_iterations
== LOOPCOUNT
));
54 for(i
= 0; i
< REPETITIONS
; i
++) {
55 if(!test_omp_single_copyprivate()) {