[flang-commits] [flang] [openmp] [flang] Changes to map variables in link clause of declare target (PR #83643)

via flang-commits flang-commits at lists.llvm.org
Wed Mar 6 12:11:50 PST 2024


================
@@ -11,23 +11,59 @@
 ! RUN: %libomptarget-compile-fortran-run-and-check-generic
 module test_0
     implicit none
-    INTEGER :: sp(10) = (/0,0,0,0,0,0,0,0,0,0/)
-    !$omp declare target link(sp)
+    INTEGER :: arr1(10) = (/0,0,0,0,0,0,0,0,0,0/)
+    INTEGER :: arr2(10) = (/0,0,0,0,0,0,0,0,0,0/)
+    !$omp declare target link(arr1) enter(arr2)
 end module test_0
 
-program main
+subroutine test_with_array_link_and_tofrom()
     use test_0
     integer :: i = 1
     integer :: j = 11
-!$omp target map(tofrom:sp, i, j)
+!$omp target map(tofrom:arr1, i, j)
     do while (i <= j)
-        sp(i) = i;
+        arr1(i) = i;
         i = i + 1
     end do
 !$omp end target
 
-PRINT *, sp(:)
+! CHECK: 1 2 3 4 5 6 7 8 9 10
+PRINT *, arr1(:)
+end subroutine test_with_array_link_and_tofrom
 
-end program
+subroutine test_with_array_link_only()
+use test_0
+integer :: i = 1
+integer :: j = 11
+!$omp target map(i, j)
----------------
agozillon wrote:

Thank you very much for humoring my testing OCD! I am sorry for the bother.

The PR looks in very good shape to me now and I'd be more than happy for it to land, but do feel free to wait on any other approvals/reviews you would like to :-)!

https://github.com/llvm/llvm-project/pull/83643


More information about the flang-commits mailing list