1 // RUN: %libomp-compile-and-run
4 #include "omp_testsuite.h"
6 int test_omp_task_firstprivate()
11 int result
= 0; /* counts the wrong sums from tasks */
13 known_sum
= 1234 + (LOOPCOUNT
* (LOOPCOUNT
+ 1)) / 2;
19 for (i
= 0; i
< NUM_TASKS
; i
++) {
20 #pragma omp task firstprivate(sum)
23 for (j
= 0; j
<= LOOPCOUNT
; j
++) {
28 /* check if calculated sum was right */
29 if (sum
!= known_sum
) {
45 for(i
= 0; i
< REPETITIONS
; i
++) {
46 if(!test_omp_task_firstprivate()) {