1 // The test supposes no offload, pure host execution.
2 // It checks that the bug in implementation of distribute construct is fixed.
4 // RUN: %libomp-compile-and-run
6 // gcc/icc target offloading is incompatible with libomp
7 // UNSUPPORTED: icc, gcc
16 omp_set_num_threads(2);
17 #pragma omp parallel reduction(+:wrong_counts)
21 int th
= omp_get_thread_num();
22 for(i
= 0; i
< size
; i
++)
25 #pragma omp target teams distribute map(tofrom: A[:size]) private(i)
26 for(i
= 0; i
< size
; i
++)
29 printf("th %d, team %d, i %d\n", th
, omp_get_team_num(), i
);
33 printf("tid = %d\n", th
);
34 for(i
= 0; i
< size
; i
++)
36 if (A
[i
] != i
) wrong_counts
++;