Files
clang-p2996/offload/test/offloading/fortran/target-map-enter-exit-array.f90
Ethan Luis McDonough 8823448807 [Offload] Refactor offload test requirements (#95196)
Many tests in the `offload` project have requirements defined by which
targets are not supported rather than which platforms are supported.
This patch aims to streamline the requirement definitions by adding four
new feature tags: `host`, `gpu`, `amdgpu`, and `nvidiagpu`.
2024-06-29 00:56:18 -05:00

36 lines
607 B
Fortran

! Offloading test checking interaction of fixed size
! arrays with enter, exit and target
! REQUIRES: flang, amdgpu
! RUN: %libomptarget-compile-fortran-run-and-check-generic
program main
integer :: A(10)
!$omp target enter data map(alloc: A)
!$omp target
do I = 1, 10
A(I) = I
end do
!$omp end target
!$omp target exit data map(from: A)
!$omp target exit data map(delete: A)
do i = 1, 10
print *, A(i)
end do
end program
! CHECK: 1
! CHECK: 2
! CHECK: 3
! CHECK: 4
! CHECK: 5
! CHECK: 6
! CHECK: 7
! CHECK: 8
! CHECK: 9
! CHECK: 10