xref: /llvm-project/offload/test/offloading/fortran/target-map-enter-exit-scalar.f90 (revision 372344995568cae076477a8b0e98fcdec7c49379)
1! Offloading test checking interaction of an enter and exit map of an scalar
2! REQUIRES: flang, amdgpu
3
4! RUN: %libomptarget-compile-fortran-run-and-check-generic
5program main
6    integer :: scalar
7    scalar = 10
8
9    !$omp target enter data map(to: scalar)
10    !ignored, as we've already attached
11    scalar = 20
12
13   !$omp target
14      scalar = scalar + 50
15   !$omp end target
16
17  !$omp target exit data map(from: scalar)
18
19  ! not the answer one may expect, but it is the same
20  ! answer Clang gives so we are correctly on par with
21  ! Clang for the moment.
22  print *, scalar
23end program
24
25!CHECK: 10
26