38 lines · plain
1! Offloading test checking interaction of allocatables with multi-dimensional2! bounds (3-D in this case) and a target region3! REQUIRES: flang, amdgpu4 5! RUN: %libomptarget-compile-fortran-run-and-check-generic6program main7 integer, allocatable :: inArray(:,:,:)8 integer, allocatable :: outArray(:,:,:)9 10 allocate(inArray(3,3,3))11 allocate(outArray(3,3,3))12 13 do i = 1, 314 do j = 1, 315 do k = 1, 316 inArray(i, j, k) = 4217 outArray(i, j, k) = 018 end do19 end do20 end do21 22!$omp target map(tofrom:inArray(1:3, 1:3, 2:2), outArray(1:3, 1:3, 1:3))23 do j = 1, 324 do k = 1, 325 outArray(k, j, 2) = inArray(k, j, 2)26 end do27 end do28!$omp end target29 30print *, outArray31 32deallocate(inArray)33deallocate(outArray)34 35end program36 37! CHECK: 0 0 0 0 0 0 0 0 0 42 42 42 42 42 42 42 42 42 0 0 0 0 0 0 0 0 038