1 // RUN: %libomp-compile-and-run
4 #include "omp_testsuite.h"
7 #pragma omp threadprivate(sum0)
9 int test_omp_for_lastprivate()
20 { /* Begin of orphaned block */
22 #pragma omp for schedule(static,7) lastprivate(i0)
23 for (i
= 1; i
<= LOOPCOUNT
; i
++) {
27 } /* end of orphaned block */
32 } /* end of critical */
33 } /* end of parallel */
35 known_sum
= (LOOPCOUNT
* (LOOPCOUNT
+ 1)) / 2;
36 fprintf(stderr
, "known_sum = %d , sum = %d\n",known_sum
,sum
);
37 fprintf(stderr
, "LOOPCOUNT = %d , i0 = %d\n",LOOPCOUNT
,i0
);
38 return ((known_sum
== sum
) && (i0
== LOOPCOUNT
));
46 for (i
= 0; i
< REPETITIONS
; i
++) {
47 if(!test_omp_for_lastprivate()) {