[Instrumentation] Fix a warning
[llvm-project.git] / offload / test / offloading / bug51982.c
blobb19707aacde983a11cdc77dc1d3dfdf1a458b641
1 // RUN: %libomptarget-compile-generic -O2 && %libomptarget-run-generic
2 // -O2 to run openmp-opt
3 // RUN: %libomptarget-compileopt-generic -O2 && %libomptarget-run-generic
5 int main(void) {
6 long int aa = 0;
8 int ng = 12;
9 int nxyz = 5;
11 const long exp = ng * nxyz;
13 #pragma omp target map(tofrom : aa)
14 for (int gid = 0; gid < nxyz; gid++) {
15 #pragma omp parallel for
16 for (unsigned int g = 0; g < ng; g++) {
17 #pragma omp atomic
18 aa += 1;
21 if (aa != exp) {
22 return 1;
24 return 0;