diff --git a/openmp/libomptarget/test/mapping/private_mapping.c b/openmp/libomptarget/test/mapping/private_mapping.c --- a/openmp/libomptarget/test/mapping/private_mapping.c +++ b/openmp/libomptarget/test/mapping/private_mapping.c @@ -4,8 +4,13 @@ #include int main() { - int data1[3] = {1}, data2[3] = {2}, data3[3] = {5}; + int data1[3] = {1, 2, 5}; + int data2[3] = {10, 20, 50}; + int data3[3] = {100, 200, 500}; int sum[16] = {0}; + + for (int i=0; i<16; i++) sum[i] = 10000; + #pragma omp target teams distribute parallel for map(tofrom : sum) \ firstprivate(data1, data2, data3) for (int i = 0; i < 16; ++i) { @@ -18,7 +23,7 @@ int correct = 1; for (int i = 0; i < 16; ++i) { - if (sum[i] != 8) { + if (sum[i] != 10888) { correct = 0; printf("ERROR: The sum for index %d is %d\n", i, sum[i]); printf("ERROR: data1 = {%d, %d, %d}\n", data1[0], data1[1], data1[2]); @@ -27,6 +32,7 @@ break; } } + fflush(stdout); assert(correct); printf("PASS\n");