brintos

brintos / llvm-project-archived public Read only

0
0
Text · 951 B · 2845bf1 Raw
37 lines · plain
1! This checks that the basic functionality of map type present functions as2! expected, emitting an omptarget error when the data is not present.3! REQUIRES: flang, amdgpu4! RUN: %libomptarget-compile-fortran-generic5! RUN: %libomptarget-run-fail-generic 2>&1 \6! RUN: | %fcheck-generic7 8! NOTE: This should intentionally fatal error in omptarget as it's not9! present, as is intended.10 subroutine target_data_not_present()11    double precision, dimension(:), allocatable :: arr12    integer, parameter :: N = 1613    integer :: i14 15    allocate(arr(N))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    deallocate(arr)28    return29end subroutine30 31program map_present32    implicit none33    call target_data_not_present()34end program35 36!CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address{{.*}}37