[llvm] [Flang][OpenMP][Offload] Add Flang offload tests for common block and declare target (PR #202949)

Sergio Afonso via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 11 02:58:57 PDT 2026


================
@@ -0,0 +1,11 @@
+! Not compiled and verified through this file, utilised by the
+! declare-target-common-block-main.f90 test to create a multiple
+! file reproducer.
+
+subroutine foo()
+  common /dxyz/ arr(10)
+  !$omp declare target (/dxyz/)
+  !$omp target map(always, tofrom: /dxyz/)
+  arr(1) = 1.0
----------------
skatrak wrote:

Nit: Feel free to ignore if you think it's not necessary for this test, but perhaps it would be a good idea to make it `arr(1) = arr(1) + 1.0` and initialize it in the main function to some non-zero value. Just to also prove that it reads the right data, and not just that it writes it.

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


More information about the llvm-commits mailing list