Skip to content

Commit

Permalink
[flang] Retain internal and BIND(C) host procedure link in FIR (#87796)
Browse files Browse the repository at this point in the history
Currently, it is not possible to find back which fun.func is the host
procedure of some internal procedure because the mangling of the
internal procedure does not contain info about the BIND(C) name of the
host.
This info may be useful to ensure dwarf DW_TAG_subprogram of internal
procedures are nested under DW_TAG_subprogram of host procedures for
instance.
  • Loading branch information
jeanPerier authored Apr 17, 2024
1 parent d9a5aa8 commit 971237d
Show file tree
Hide file tree
Showing 16 changed files with 119 additions and 69 deletions.
4 changes: 0 additions & 4 deletions flang/include/flang/Lower/CallInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,6 @@ class CallerInterface : public CallInterface<CallerInterface> {
llvm_unreachable("getting host associated type in CallerInterface");
}

/// Set attributes on MLIR function.
void setFuncAttrs(mlir::func::FuncOp) const {}

private:
/// Check that the input vector is complete.
bool verifyActualInputs() const;
Expand Down Expand Up @@ -444,7 +441,6 @@ class CalleeInterface : public CallInterface<CalleeInterface> {
bool hasHostAssociated() const;
mlir::Type getHostAssociatedTy() const;
mlir::Value getHostAssociatedTuple() const;
void setFuncAttrs(mlir::func::FuncOp) const;

private:
Fortran::lower::pft::FunctionLikeUnit &funit;
Expand Down
10 changes: 5 additions & 5 deletions flang/include/flang/Optimizer/Dialect/FIROpsSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ static constexpr llvm::StringRef getHostAssocAttrName() {
return "fir.host_assoc";
}

/// Attribute to mark an internal procedure.
static constexpr llvm::StringRef getInternalProcedureAttrName() {
return "fir.internal_proc";
/// Attribute to link an internal procedure to its host procedure symbol.
static constexpr llvm::StringRef getHostSymbolAttrName() {
return "fir.host_symbol";
}

/// Attribute containing the original name of a function from before the
Expand All @@ -122,8 +122,8 @@ bool hasHostAssociationArgument(mlir::func::FuncOp func);
/// Is the function, \p func an internal procedure ?
/// Some internal procedures may have access to saved host procedure
/// variables even when they do not have a tuple argument.
inline bool isInternalPorcedure(mlir::func::FuncOp func) {
return func->hasAttr(fir::getInternalProcedureAttrName());
inline bool isInternalProcedure(mlir::func::FuncOp func) {
return func->hasAttr(fir::getHostSymbolAttrName());
}

/// Tell if \p value is:
Expand Down
40 changes: 28 additions & 12 deletions flang/lib/Lower/CallInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,20 +575,41 @@ mlir::Value Fortran::lower::CalleeInterface::getHostAssociatedTuple() const {
return converter.hostAssocTupleValue();
}

void Fortran::lower::CalleeInterface::setFuncAttrs(
mlir::func::FuncOp func) const {
if (funit.parentHasHostAssoc())
func->setAttr(fir::getInternalProcedureAttrName(),
mlir::UnitAttr::get(func->getContext()));
}

//===----------------------------------------------------------------------===//
// CallInterface implementation: this part is common to both caller and callee.
//===----------------------------------------------------------------------===//

static void addSymbolAttribute(mlir::func::FuncOp func,
const Fortran::semantics::Symbol &sym,
mlir::MLIRContext &mlirContext) {
const Fortran::semantics::Symbol &ultimate = sym.GetUltimate();
// The link between an internal procedure and its host procedure is lost
// in FIR if the host is BIND(C) since the internal mangling will not
// allow retrieving the host bind(C) name, and therefore func.func symbol.
// Preserve it as an attribute so that this can be later retrieved.
if (Fortran::semantics::ClassifyProcedure(ultimate) ==
Fortran::semantics::ProcedureDefinitionClass::Internal) {
if (ultimate.owner().kind() ==
Fortran::semantics::Scope::Kind::Subprogram) {
if (const Fortran::semantics::Symbol *hostProcedure =
ultimate.owner().symbol()) {
std::string hostName = Fortran::lower::mangle::mangleName(
*hostProcedure, /*keepExternalInScope=*/true);
func->setAttr(
fir::getHostSymbolAttrName(),
mlir::SymbolRefAttr::get(
&mlirContext, mlir::StringAttr::get(&mlirContext, hostName)));
}
} else if (ultimate.owner().kind() ==
Fortran::semantics::Scope::Kind::MainProgram) {
func->setAttr(fir::getHostSymbolAttrName(),
mlir::SymbolRefAttr::get(
&mlirContext,
mlir::StringAttr::get(
&mlirContext, fir::NameUniquer::doProgramEntry())));
}
}

// Only add this on bind(C) functions for which the symbol is not reflected in
// the current context.
if (!Fortran::semantics::IsBindCProcedure(sym))
Expand Down Expand Up @@ -686,7 +707,6 @@ void Fortran::lower::CallInterface<T>::declare() {
for (const auto &placeHolder : llvm::enumerate(inputs))
if (!placeHolder.value().attributes.empty())
func.setArgAttrs(placeHolder.index(), placeHolder.value().attributes);
side().setFuncAttrs(func);

setCUDAAttributes(func, side().getProcedureSymbol(), characteristic);
}
Expand Down Expand Up @@ -1599,10 +1619,6 @@ class SignatureBuilder
return proc;
}

/// Set internal procedure attribute on MLIR function. Internal procedure
/// are defined in the current file and will not go through SignatureBuilder.
void setFuncAttrs(mlir::func::FuncOp) const {}

/// This is not the description of an indirect call.
static constexpr bool isIndirectCall() { return false; }

Expand Down
2 changes: 1 addition & 1 deletion flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ conservativeCallConflict(llvm::ArrayRef<mlir::Operation *> reaches) {
if (auto callee =
call.getCallableForCallee().dyn_cast<mlir::SymbolRefAttr>()) {
auto module = op->getParentOfType<mlir::ModuleOp>();
return isInternalPorcedure(
return isInternalProcedure(
module.lookupSymbol<mlir::func::FuncOp>(callee));
}
return false;
Expand Down
39 changes: 39 additions & 0 deletions flang/test/Lower/HLFIR/internal-procedures-bindc-host.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
! Test fir.host_sym attribute to retain link between internal
! and host procedure in FIR even when BIND(C) is involved.

! RUN: bbc -emit-hlfir -o - %s | FileCheck %s
! RUN: bbc -emit-hlfir -o - %s | fir-opt -external-name-interop -o - |FileCheck %s --check-prefix=AFTER_RENAME_PASS

subroutine foo() bind(c, name="some_c_name")
call bar()
contains
subroutine bar()
end subroutine
end subroutine
! CHECK: func.func @some_c_name()
! CHECK: func.func private @_QFfooPbar() attributes {fir.host_symbol = @some_c_name, llvm.linkage = #llvm.linkage<internal>}
! AFTER_RENAME_PASS: func.func @some_c_name()
! AFTER_RENAME_PASS: func.func private @_QFfooPbar() attributes {fir.host_symbol = @some_c_name, llvm.linkage = #llvm.linkage<internal>}

subroutine notbindc()
call bar()
contains
subroutine bar()
end subroutine
end subroutine
! CHECK: func.func @_QPnotbindc()
! CHECK: func.func private @_QFnotbindcPbar() attributes {fir.host_symbol = @_QPnotbindc, llvm.linkage = #llvm.linkage<internal>}
! AFTER_RENAME_PASS: func.func @notbindc_() attributes {fir.internal_name = "_QPnotbindc"}
! AFTER_RENAME_PASS: func.func private @_QFnotbindcPbar() attributes {fir.host_symbol = @notbindc_, llvm.linkage = #llvm.linkage<internal>}


! Main program
call bar()
contains
subroutine bar()
end subroutine
end
! CHECK: func.func @_QQmain()
! CHECK: func.func private @_QFPbar() attributes {fir.host_symbol = @_QQmain, llvm.linkage = #llvm.linkage<internal>}
! AFTER_RENAME_PASS: func.func @_QQmain()
! AFTER_RENAME_PASS: func.func private @_QFPbar() attributes {fir.host_symbol = @_QQmain, llvm.linkage = #llvm.linkage<internal>}
6 changes: 3 additions & 3 deletions flang/test/Lower/HLFIR/internal-procedures.f90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ subroutine internal
end subroutine
end subroutine
! CHECK-LABEL: func.func private @_QFtest_explicit_shape_arrayPinternal(
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<tuple<!fir.box<!fir.array<?xf32>>>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage<internal>} {
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<tuple<!fir.box<!fir.array<?xf32>>>> {fir.host_assoc}) attributes {fir.host_symbol = {{.*}}, llvm.linkage = #llvm.linkage<internal>} {
! CHECK: %[[VAL_1:.*]] = arith.constant 0 : i32
! CHECK: %[[VAL_2:.*]] = fir.coordinate_of %[[VAL_0]], %[[VAL_1]] : (!fir.ref<tuple<!fir.box<!fir.array<?xf32>>>>, i32) -> !fir.ref<!fir.box<!fir.array<?xf32>>>
! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_2]] : !fir.ref<!fir.box<!fir.array<?xf32>>>
Expand All @@ -28,7 +28,7 @@ subroutine internal
end subroutine
end subroutine
! CHECK-LABEL: func.func private @_QFtest_assumed_shapePinternal(
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<tuple<!fir.box<!fir.array<?xf32>>>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage<internal>} {
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<tuple<!fir.box<!fir.array<?xf32>>>> {fir.host_assoc}) attributes {fir.host_symbol = {{.*}}, llvm.linkage = #llvm.linkage<internal>} {
! CHECK: %[[VAL_1:.*]] = arith.constant 0 : i32
! CHECK: %[[VAL_2:.*]] = fir.coordinate_of %[[VAL_0]], %[[VAL_1]] : (!fir.ref<tuple<!fir.box<!fir.array<?xf32>>>>, i32) -> !fir.ref<!fir.box<!fir.array<?xf32>>>
! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_2]] : !fir.ref<!fir.box<!fir.array<?xf32>>>
Expand All @@ -45,7 +45,7 @@ subroutine internal()
end subroutine
end subroutine
! CHECK-LABEL: func.func private @_QFtest_scalar_charPinternal(
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<tuple<!fir.boxchar<1>>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage<internal>} {
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<tuple<!fir.boxchar<1>>> {fir.host_assoc}) attributes {fir.host_symbol = {{.*}}, llvm.linkage = #llvm.linkage<internal>} {
! CHECK: %[[VAL_1:.*]] = arith.constant 0 : i32
! CHECK: %[[VAL_2:.*]] = fir.coordinate_of %[[VAL_0]], %[[VAL_1]] : (!fir.ref<tuple<!fir.boxchar<1>>>, i32) -> !fir.ref<!fir.boxchar<1>>
! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_2]] : !fir.ref<!fir.boxchar<1>>
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/OpenACC/acc-routine04.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ subroutine sub2()
! CHECK: acc.routine @acc_routine_0 func(@_QMdummy_modPsub1) seq
! CHECK: func.func @_QMdummy_modPsub1(%arg0: !fir.ref<i32> {fir.bindc_name = "i"}) attributes {acc.routine_info = #acc.routine_info<[@acc_routine_0]>}
! CHECK: func.func @_QQmain() attributes {fir.bindc_name = "test_acc_routine"}
! CHECK: func.func private @_QFPsub2() attributes {acc.routine_info = #acc.routine_info<[@acc_routine_1]>, llvm.linkage = #llvm.linkage<internal>}
! CHECK: func.func private @_QFPsub2() attributes {acc.routine_info = #acc.routine_info<[@acc_routine_1]>, fir.host_symbol = @_QQmain, llvm.linkage = #llvm.linkage<internal>}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
!CHECK: fir.call @_QFPsub() fastmath<contract> : () -> ()
!CHECK: return
!CHECK: }
!CHECK: func.func private @_QFPsub() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage<internal>} {
!CHECK: func.func private @_QFPsub() attributes {fir.host_symbol = {{.*}}, llvm.linkage = #llvm.linkage<internal>} {
!CHECK: %[[A:.*]] = fir.alloca i32 {bindc_name = "a", uniq_name = "_QFEa"}
!CHECK: %[[A_DECL:.*]]:2 = hlfir.declare %[[A]] {uniq_name = "_QFEa"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
!CHECK: %[[A_ADDR:.*]] = fir.address_of(@_QFEa) : !fir.ref<i32>
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/OpenMP/threadprivate-host-association.f90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
!CHECK: fir.call @_QFPsub() fastmath<contract> : () -> ()
!CHECK: return
!CHECK: }
!CHECK: func.func private @_QFPsub() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage<internal>} {
!CHECK: func.func private @_QFPsub() attributes {fir.host_symbol = {{.*}}, llvm.linkage = #llvm.linkage<internal>} {
!CHECK: %[[A:.*]] = fir.address_of(@_QFEa) : !fir.ref<i32>
!CHECK: %[[A_DECL:.*]]:2 = hlfir.declare %[[A]] {uniq_name = "_QFEa"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
!CHECK: %[[TP_A:.*]] = omp.threadprivate %[[A_DECL]]#1 : !fir.ref<i32> -> !fir.ref<i32>
Expand Down
15 changes: 7 additions & 8 deletions flang/test/Lower/character-elemental.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ subroutine substring_main
character*7 :: string(2) = ['12 ', '12 ']
integer :: result(2)
integer :: ival
interface
elemental function inner(arg)
character(len=*), intent(in) :: arg
integer :: inner
end function inner
end interface

ival = 1
! CHECK: %[[a0:.*]] = fir.alloca i32 {bindc_name = "ival", uniq_name = "_QFsubstring_mainEival"}
Expand All @@ -26,14 +32,7 @@ subroutine substring_main
! CHECK: %[[a14:.*]] = fir.coordinate_of %[[a13]], %[[a12]] : (!fir.ref<!fir.array<7x!fir.char<1>>>, index) -> !fir.ref<!fir.char<1>>
! CHECK: %[[a15:.*]] = fir.convert %[[a14]] : (!fir.ref<!fir.char<1>>) -> !fir.ref<!fir.char<1,?>>
! CHECK: %[[a16:.*]] = fir.emboxchar %[[a15]], {{.*}} : (!fir.ref<!fir.char<1,?>>, index) -> !fir.boxchar<1>
! CHECK: %[[a17:.*]] = fir.call @_QFsubstring_mainPinner(%[[a16]]) {{.*}}: (!fir.boxchar<1>) -> i32
! CHECK: %[[a17:.*]] = fir.call @_QPinner(%[[a16]]) {{.*}}: (!fir.boxchar<1>) -> i32
result = inner(string(1:2)(ival:ival))
print *, result
contains
elemental function inner(arg)
character(len=*), intent(in) :: arg
integer :: inner

inner = len(arg)
end function inner
end subroutine substring_main
16 changes: 8 additions & 8 deletions flang/test/Lower/equivalence-with-host-assoc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ subroutine inner
i1 = j1
end subroutine inner
end subroutine test1
! FIR-LABEL: func.func private @_QFtest1Pinner() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage<internal>} {
! FIR-LABEL: func.func private @_QFtest1Pinner() attributes {fir.host_symbol = {{.*}}, llvm.linkage = #llvm.linkage<internal>} {
! FIR: %[[VAL_0:.*]] = fir.address_of(@_QFtest1Ei1) : !fir.ref<!fir.array<1xi32>>
! FIR: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref<!fir.array<1xi32>>) -> !fir.ref<!fir.array<4xi8>>
! FIR: %[[VAL_2:.*]] = arith.constant 0 : index
Expand All @@ -24,7 +24,7 @@ end subroutine test1
! FIR: return
! FIR: }

! HLFIR-LABEL: func.func private @_QFtest1Pinner() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage<internal>} {
! HLFIR-LABEL: func.func private @_QFtest1Pinner() attributes {fir.host_symbol = {{.*}}, llvm.linkage = #llvm.linkage<internal>} {
! HLFIR: %[[VAL_0:.*]] = fir.address_of(@_QFtest1Ei1) : !fir.ref<!fir.array<1xi32>>
! HLFIR: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref<!fir.array<1xi32>>) -> !fir.ref<!fir.array<4xi8>>
! HLFIR: %[[VAL_2:.*]] = arith.constant 0 : index
Expand Down Expand Up @@ -54,7 +54,7 @@ subroutine inner
end subroutine inner
end subroutine host
end module test2
! FIR-LABEL: func.func private @_QMtest2FhostPinner() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage<internal>} {
! FIR-LABEL: func.func private @_QMtest2FhostPinner() attributes {fir.host_symbol = {{.*}}, llvm.linkage = #llvm.linkage<internal>} {
! FIR: %[[VAL_0:.*]] = fir.address_of(@_QMtest2FhostEf1) : !fir.ref<!fir.array<1xi32>>
! FIR: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref<!fir.array<1xi32>>) -> !fir.ref<!fir.array<4xi8>>
! FIR: %[[VAL_2:.*]] = arith.constant 0 : index
Expand All @@ -68,7 +68,7 @@ end module test2
! FIR: return
! FIR: }

! HLFIR-LABEL: func.func private @_QMtest2FhostPinner() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage<internal>} {
! HLFIR-LABEL: func.func private @_QMtest2FhostPinner() attributes {fir.host_symbol = {{.*}}, llvm.linkage = #llvm.linkage<internal>} {
! HLFIR: %[[VAL_0:.*]] = fir.address_of(@_QMtest2FhostEf1) : !fir.ref<!fir.array<1xi32>>
! HLFIR: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref<!fir.array<1xi32>>) -> !fir.ref<!fir.array<4xi8>>
! HLFIR: %[[VAL_2:.*]] = arith.constant 0 : index
Expand All @@ -94,7 +94,7 @@ subroutine inner
i1 = j1 + k1
end subroutine inner
end subroutine test3
! FIR-LABEL: func.func private @_QFtest3Pinner() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage<internal>} {
! FIR-LABEL: func.func private @_QFtest3Pinner() attributes {fir.host_symbol = {{.*}}, llvm.linkage = #llvm.linkage<internal>} {
! FIR: %[[VAL_0:.*]] = fir.address_of(@blk_) : !fir.ref<tuple<i32>>
! FIR: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref<tuple<i32>>) -> !fir.ref<!fir.array<?xi8>>
! FIR: %[[VAL_2:.*]] = arith.constant 0 : index
Expand All @@ -115,7 +115,7 @@ end subroutine test3
! FIR: return
! FIR: }

! HLFIR-LABEL: func.func private @_QFtest3Pinner() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage<internal>} {
! HLFIR-LABEL: func.func private @_QFtest3Pinner() attributes {fir.host_symbol = {{.*}}, llvm.linkage = #llvm.linkage<internal>} {
! HLFIR: %[[VAL_0:.*]] = fir.address_of(@blk_) : !fir.ref<tuple<i32>>
! HLFIR: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref<tuple<i32>>) -> !fir.ref<!fir.array<?xi8>>
! HLFIR: %[[VAL_2:.*]] = arith.constant 0 : index
Expand Down Expand Up @@ -149,7 +149,7 @@ subroutine inner
i1 = j1 + k1
end subroutine inner
end subroutine test4
! FIR-LABEL: func.func private @_QFtest4Pinner() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage<internal>} {
! FIR-LABEL: func.func private @_QFtest4Pinner() attributes {fir.host_symbol = {{.*}}, llvm.linkage = #llvm.linkage<internal>} {
! FIR: %[[VAL_0:.*]] = fir.address_of(@blk_) : !fir.ref<tuple<i32>>
! FIR: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref<tuple<i32>>) -> !fir.ref<!fir.array<?xi8>>
! FIR: %[[VAL_2:.*]] = arith.constant 0 : index
Expand All @@ -170,7 +170,7 @@ end subroutine test4
! FIR: return
! FIR: }

! HLFIR-LABEL: func.func private @_QFtest4Pinner() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage<internal>} {
! HLFIR-LABEL: func.func private @_QFtest4Pinner() attributes {fir.host_symbol = {{.*}}, llvm.linkage = #llvm.linkage<internal>} {
! HLFIR: %[[VAL_0:.*]] = fir.address_of(@blk_) : !fir.ref<tuple<i32>>
! HLFIR: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref<tuple<i32>>) -> !fir.ref<!fir.array<?xi8>>
! HLFIR: %[[VAL_2:.*]] = arith.constant 0 : index
Expand Down
4 changes: 2 additions & 2 deletions flang/test/Lower/explicit-interface-results-2.f90
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ subroutine host4()
call internal_proc_a()
contains
! CHECK-LABEL: func private @_QFhost4Pinternal_proc_a
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<tuple<!fir.ref<i32>>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage<internal>} {
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<tuple<!fir.ref<i32>>> {fir.host_assoc}) attributes {fir.host_symbol = {{.*}}, llvm.linkage = #llvm.linkage<internal>} {
subroutine internal_proc_a()
call takes_array(return_array())
! CHECK: %[[VAL_1:.*]] = arith.constant 0 : i32
Expand All @@ -94,7 +94,7 @@ subroutine host5()
implicit none
call internal_proc_a()
contains
! CHECK-LABEL: func private @_QFhost5Pinternal_proc_a() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage<internal>} {
! CHECK-LABEL: func private @_QFhost5Pinternal_proc_a() attributes {fir.host_symbol = {{.*}}, llvm.linkage = #llvm.linkage<internal>} {
subroutine internal_proc_a()
call takes_array(return_array())
! CHECK: %[[VAL_0:.*]] = fir.address_of(@_QMsome_moduleEn_module) : !fir.ref<i32>
Expand Down
Loading

0 comments on commit 971237d

Please sign in to comment.