[Openmp-commits] [openmp] [OpenMP][flang] Adding more tests for commonblock with target map (PR #71146)

Akash Banerjee via Openmp-commits openmp-commits at lists.llvm.org
Thu Nov 30 04:25:44 PST 2023


================
@@ -80,3 +87,61 @@ subroutine commonblock_simple_with_real
 
 ! CHECK: var3 before target = 12.5
 ! CHECK: var3 after target = 14.5
+
+! -----
+
+subroutine commonblock_simple_to
+  use omp_lib
+  integer :: var4, tmp
+  common var4
+  var4 = 10
+  tmp = 20
+  !$omp target map(to:var4) map(from:tmp)
+    tmp = var4
+    var4 = 20
+  !$omp end target
+  print *, "var4 after target = ", var4
+  print *, "tmp after target = ", tmp
+end subroutine
+
+! CHECK: var4 after target = 10
+! CHECK: tmp after target = 10
+
+! -----
+
+subroutine commonblock_simple_from
----------------
TIFitis wrote:

Test `commonblock_simple_to` is already testing the `for` map-type isn't it?

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


More information about the Openmp-commits mailing list