[flang-commits] [flang] [OpenMP] Add PointerAssociateScalar to Cray Pointer used in the DSA (PR #133232)
Thirumalai Shaktivel via flang-commits
flang-commits at lists.llvm.org
Fri Mar 28 10:28:06 PDT 2025
================
@@ -0,0 +1,33 @@
+! Test lowering of Cray pointee references.
+! RUN: bbc -emit-hlfir -fopenmp %s -o - 2>&1 | FileCheck %s
+
+module test_host_assoc_cray_pointer
+ ! CHECK-LABEL: fir.global @_QMtest_host_assoc_cray_pointerEivar : i64
+ real*8 var(*)
+ ! CHECK-LABEL: fir.global @_QMtest_host_assoc_cray_pointerEvar : !fir.array<?xf64>
+ pointer(ivar,var)
+
+contains
+
+ ! CHECK-LABEL: func.func @_QMtest_host_assoc_cray_pointerPset_cray_pointer()
+ subroutine set_cray_pointer
+ ! CHECK: %[[ALLOCA:.*]] = fir.alloca !fir.box<!fir.ptr<!fir.array<?xf64>>>
+ ! CHECK: %[[IVAR_ADDR:.*]] = fir.address_of(@_QMtest_host_assoc_cray_pointerEivar) : !fir.ref<i64>
+ ! CHECK: %[[IVAR_DECL:.*]]:2 = hlfir.declare %[[IVAR_ADDR]] {uniq_name = "_QMtest_host_assoc_cray_pointerEivar"} : (!fir.ref<i64>) -> (!fir.ref<i64>, !fir.ref<i64>)
+ ! CHECK: %[[VAR_DECL:.*]]:2 = hlfir.declare %[[ALLOCA]] {fortran_attrs = #fir.var_attrs<pointer>, uniq_name = "_QMtest_host_assoc_cray_pointerEvar"} : (!fir.ref<!fir.box<!fir.ptr<!fir.array<?xf64>>>>) -> (!fir.ref<!fir.box<!fir.ptr<!fir.array<?xf64>>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf64>>>>)
+ real*8 pointee(2)
+ pointee(1) = 42.0
+
+ ivar = loc(pointee)
+
+ !$omp parallel default(none) shared(ivar)
----------------
Thirumalai-Shaktivel wrote:
Done
https://github.com/llvm/llvm-project/pull/133232
More information about the flang-commits
mailing list