41 lines · plain
1! Test the implicit `declare target to` interaction with `target update from`2! REQUIRES: flang, amdgpu3 4! RUN: %libomptarget-compile-fortran-run-and-check-generic5module test6 implicit none7 integer :: array(10)8 !$omp declare target(array)9end module test10 11PROGRAM main12 use test13 implicit none14 integer :: i15 16 do i = 1, 1017 array(i) = 018 end do19 20 !$omp target21 do i = 1, 1022 array(i) = i23 end do24 !$omp end target25 26 !$omp target27 do i = 1, 1028 array(i) = array(i) + i29 end do30 !$omp end target31 32 print *, array33 34 !$omp target update from(array)35 36 print *, array37END PROGRAM38 39! CHECK: 0 0 0 0 0 0 0 0 0 040! CHECK: 2 4 6 8 10 12 14 16 18 2041