Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / offloading / fortran / target-map-enter-exit-array-bounds.f90
blobcae1d47013f6221b65f891cebbf892650b99b023
1 ! Offloading test checking interaction of an
2 ! enter and exit map of an array of scalars
3 ! with specified bounds
4 ! REQUIRES: flang, amdgpu
6 ! RUN: %libomptarget-compile-fortran-run-and-check-generic
8 program main
9 integer :: array(10)
11 do I = 1, 10
12 array(I) = I + I
13 end do
15 !$omp target enter data map(to: array(3:6))
16 ! Shouldn't overwrite data already locked in
17 ! on target via enter, which will then be
18 ! overwritten by our exit
19 do I = 1, 10
20 array(I) = 10
21 end do
23 ! The compiler/runtime is less lenient about read/write out of
24 ! bounds when using enter and exit, we have to specifically loop
25 ! over the correctly mapped range
26 !$omp target
27 do i=3,6
28 array(i) = array(i) + i
29 end do
30 !$omp end target
32 !$omp target exit data map(from: array(3:6))
33 print *, array
34 end program
36 !CHECK: 10 10 9 12 15 18 10 10 10 10