xref: /llvm-project/offload/test/offloading/fortran/target-map-nullary-pointer.f90 (revision e0054e984cac39322afa32a6e68fc794f0081f49)
1! Offloading test with a target region mapping a null-ary (no target or
2! allocated data) to device, and then setting the target on device before
3! printing the changed target on host.
4! REQUIRES: flang, amdgpu
5
6! RUN: %libomptarget-compile-fortran-run-and-check-generic
7program main
8    implicit none
9    integer,    pointer :: Set
10    integer,    target, allocatable :: Set_Target
11
12    allocate(Set_Target)
13
14    Set_Target = 30
15
16!$omp target map(Set)
17    Set => Set_Target
18    Set = 45
19!$omp end target
20
21    print *, Set_Target
22end program main
23
24! CHECK: 45
25