42 lines · plain
1! This checks that the basic functionality of map type present functions as2! expected, no-op'ng when present3! REQUIRES: flang, amdgpu4! RUN: %libomptarget-compile-fortran-run-and-check-generic5 6 subroutine target_data_present()7 double precision, dimension(:), allocatable :: arr8 integer, parameter :: N = 169 integer :: i10 11 allocate(arr(N))12 13 arr(:) = 10.0d014 15!$omp target data map(tofrom:arr)16 17!$omp target data map(present,alloc:arr)18 19!$omp target20 do i = 1,N21 arr(i) = 42.0d022 end do23!$omp end target24 25!$omp end target data26 27!$omp end target data28 29 print *, arr30 31 deallocate(arr)32 33 return34end subroutine35 36program map_present37 implicit none38 call target_data_present()39end program40 41!CHECK: 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42.42