! Test lowering of Cray pointee references. ! RUN: bbc -emit-hlfir -fopenmp %s -o - 2>&1 | FileCheck %s ! XFAIL: * 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 pointer(ivar,var) contains ! CHECK-LABEL: func.func private @_FortranAPointerAssociateScalar(!fir.ref>, !fir.llvm_ptr) attributes {fir.runtime} subroutine set_cray_pointer ! CHECK: %[[ALLOCA:.*]] = fir.alloca !fir.box>> ! CHECK: %[[IVAR_ADDR:.*]] = fir.address_of(@_QMtest_host_assoc_cray_pointerEivar) : !fir.ref ! CHECK: %[[IVAR_DECL:.*]]:2 = hlfir.declare %[[IVAR_ADDR]] {fortran_attrs = #fir.var_attrs, uniq_name = "_QMtest_host_assoc_cray_pointerEivar"} : (!fir.ref) -> (!fir.ref, !fir.ref) ! CHECK: %[[VAR_DECL:.*]]:2 = hlfir.declare %[[ALLOCA]] {fortran_attrs = #fir.var_attrs, uniq_name = "_QMtest_host_assoc_cray_pointerEvar"} : (!fir.ref>>>) -> (!fir.ref>>>, !fir.ref>>>) real*8 pointee(2) pointee(1) = 42.0 ivar = loc(pointee) !$omp parallel default(none) shared(ivar) ! CHECK: omp.parallel ! CHECK: %[[I_01:.*]] = fir.convert %[[IVAR_DECL]]#0 : (!fir.ref) -> !fir.ref> ! CHECK: %[[I_02:.*]] = fir.load %[[I_01]] : !fir.ref> ! CHECK: %[[I_03:.*]] = fir.convert %[[VAR_DECL]]#0 : (!fir.ref>>>) -> !fir.ref> ! CHECK: %[[I_04:.*]] = fir.convert %[[I_02]] : (!fir.ptr) -> !fir.llvm_ptr ! CHECK: fir.call @_FortranAPointerAssociateScalar(%[[I_03]], %[[I_04]]) fastmath : (!fir.ref>, !fir.llvm_ptr) -> () print *, var(1) !$omp end parallel end subroutine end module