31 lines · plain
1!REQUIRES: flang, amdgpu2 3!RUN: %libomptarget-compile-fortran-run-and-check-generic4 5function f(x) result(y)6 integer :: x(:)7 integer :: y, z8 x = 09 y = 1110 !$omp target data map(tofrom: x) use_device_addr(x)11 !$omp target has_device_addr(x) map(tofrom: y)12 y = size(x)13 !$omp end target14 !$omp end target data15end16 17program main18 interface19 function f(x) result(y)20 integer :: x(:)21 integer :: y22 end function23 end interface24 integer :: x(13)25 integer :: y26 y = f(x)27 print *, "y=", y28end29 30!CHECK: y= 1331