diff --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp --- a/flang/lib/Lower/OpenACC.cpp +++ b/flang/lib/Lower/OpenACC.cpp @@ -2854,7 +2854,7 @@ AbstractConverter &converter, fir::FirOpBuilder &builder, const Fortran::semantics::Symbol &sym) { std::stringstream fctName; - fctName << converter.mangleName(sym) << declarePostAllocSuffix.str(); + fctName << converter.mangleName(sym) << declarePostDeallocSuffix.str(); mlir::Operation &op = builder.getInsertionBlock()->back(); op.setAttr(mlir::acc::getDeclareActionAttrName(), mlir::acc::DeclareActionAttr::get( diff --git a/flang/test/Lower/OpenACC/acc-declare.f90 b/flang/test/Lower/OpenACC/acc-declare.f90 --- a/flang/test/Lower/OpenACC/acc-declare.f90 +++ b/flang/test/Lower/OpenACC/acc-declare.f90 @@ -279,7 +279,7 @@ ! CHECK: %{{.*}} = fir.box_addr %{{.*}} {acc.declare_action = #acc.declare_action} : (!fir.box>>) -> !fir.heap> ! CHECK: fir.freemem %{{.*}} : !fir.heap> -! CHECK: fir.store %{{.*}} to %{{.*}} {acc.declare_action = #acc.declare_action} : !fir.ref>>> +! CHECK: fir.store %{{.*}} to %{{.*}} {acc.declare_action = #acc.declare_action} : !fir.ref>>> end subroutine @@ -347,6 +347,6 @@ use acc_declare_allocatable_test deallocate(data1) ! CHECK: %{{.*}} = fir.box_addr %{{.*}} {acc.declare_action = #acc.declare_action} : (!fir.box>>) -> !fir.heap> -! CHECK: fir.store %{{.*}} to %{{.*}} {acc.declare_action = #acc.declare_action} : !fir.ref>>> +! CHECK: fir.store %{{.*}} to %{{.*}} {acc.declare_action = #acc.declare_action} : !fir.ref>>> end subroutine end module