[flang-commits] [flang] [llvm] [mlir] [Flang][OpenMP] Fix Fortran automap handling (PR #162501)
Akash Banerjee via flang-commits
flang-commits at lists.llvm.org
Thu Jun 18 07:54:27 PDT 2026
================
@@ -0,0 +1,27 @@
+! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=60 %s -o - | FileCheck %s
+
+program automap_program
+ integer, allocatable, target :: automap_array(:)
+ !$omp declare target enter(automap:automap_array)
+
+ allocate (automap_array(10))
+
+ !$omp target
----------------
TIFitis wrote:
Thanks, this is now rebased past #200248. I kept the test as `declare target enter(automap:...)` since that is the case from #161265 that this PR is fixing.
The descriptor map is emitted with `always,to,ref_ptr`, so the infinite refcount issue for declare-target mappings is handled for the descriptor. The allocated storage is mapped separately with `storage`, and the finalisation pass emits the attach map.
https://github.com/llvm/llvm-project/pull/162501
More information about the flang-commits
mailing list