36 lines · plain
1! Offloading test checking interaction of an enter and exit map of an array of2! scalars with specified bounds3! REQUIRES: flang, amdgpu4 5! RUN: %libomptarget-compile-fortran-run-and-check-generic6 7program main8 integer :: array(10)9 10 do I = 1, 1011 array(I) = I + I12 end do13 14 !$omp target enter data map(to: array(3:6))15 ! Shouldn't overwrite data already locked in16 ! on target via enter, which will then be17 ! overwritten by our exit18 do I = 1, 1019 array(I) = 1020 end do21 22 ! The compiler/runtime is less lenient about read/write out of23 ! bounds when using enter and exit, we have to specifically loop24 ! over the correctly mapped range25 !$omp target26 do i=3,627 array(i) = array(i) + i28 end do29 !$omp end target30 31 !$omp target exit data map(from: array(3:6))32 print *, array33end program34 35!CHECK: 10 10 9 12 15 18 10 10 10 1036