Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / offloading / bug51982.c
blobc037d215a8a793f16066e8a84f444245d5b284fc
1 // RUN: %libomptarget-compile-generic -O1 && %libomptarget-run-generic
2 // -O1 to run openmp-opt
3 // RUN: %libomptarget-compileopt-generic -O1 && %libomptarget-run-generic
4 // XFAIL: amdgcn-amd-amdhsa
6 int main(void) {
7 long int aa = 0;
9 int ng = 12;
10 int nxyz = 5;
12 const long exp = ng * nxyz;
14 #pragma omp target map(tofrom : aa)
15 for (int gid = 0; gid < nxyz; gid++) {
16 #pragma omp parallel for
17 for (unsigned int g = 0; g < ng; g++) {
18 #pragma omp atomic
19 aa += 1;
22 if (aa != exp) {
23 return 1;
25 return 0;