From e53efd3f64c096e6dd17694d5dc89487253b2390 Mon Sep 17 00:00:00 2001 From: Jean Perier Date: Tue, 5 Sep 2023 07:06:06 -0700 Subject: [PATCH] [flang] Use BIND name, if any, when consolidating common blocks Semantics is maintaining a list of common blocks appearing in the file to allow for the extension where a common may appear with different size. It needs to account for BIND(C) name when matching the names. What matters is to merge the common block with similar global name. This patch allows merging BIND(C) and non BIND(C) common blocks that end up having the same name in the object file (previously, this crashed when lowering FIR to LLVM). This is not well specified, but matches what gfortran, ifort and nvfortran are doing and what would happen if the common block had been in different files. To support this use case, the mangling of common blocks (_QC) has to be dropped for all common blocks. There was no such mangling for BIND(C) common already anyway, and the mangling did not bring a lot of valuable info since there was no scope information (common block are common to all scopes). If needed, an MLIR attribute could be added instead to flag that a fir.global is a common block (the linkage is a good hint already, although there may be use case for using this linkage for objects that are not user defined common block form the Fortran source). --- flang/include/flang/Common/Fortran.h | 2 + flang/include/flang/Lower/LoweringOptions.def | 3 ++ flang/include/flang/Lower/Mangler.h | 6 ++- flang/include/flang/Semantics/semantics.h | 6 +++ flang/include/flang/Semantics/tools.h | 3 ++ flang/lib/Frontend/CompilerInvocation.cpp | 4 +- flang/lib/Lower/Bridge.cpp | 4 +- flang/lib/Lower/Mangler.cpp | 17 +++---- .../Transforms/ExternalNameConversion.cpp | 3 +- flang/lib/Semantics/semantics.cpp | 12 ++++- flang/lib/Semantics/tools.cpp | 11 +++++ .../HLFIR/common-block-bindc-conflicts.f90 | 47 +++++++++++++++++++ flang/test/Lower/OpenMP/copyin.f90 | 4 +- .../test/Lower/OpenMP/declare-target-data.f90 | 6 +-- .../Lower/OpenMP/firstprivate-commonblock.f90 | 2 +- .../Lower/OpenMP/lastprivate-commonblock.f90 | 2 +- .../test/Lower/OpenMP/private-commonblock.f90 | 4 +- .../threadprivate-common-block-hlfir.f90 | 2 +- .../OpenMP/threadprivate-commonblock.f90 | 4 +- .../OpenMP/threadprivate-use-association.f90 | 8 ++-- flang/test/Lower/array.f90 | 2 +- flang/test/Lower/common-block-2.f90 | 4 +- flang/test/Lower/common-block.f90 | 22 ++++----- flang/test/Lower/equivalence-2.f90 | 2 +- .../Lower/explicit-interface-results-2.f90 | 8 ++-- flang/test/Lower/host-associated-globals.f90 | 2 +- flang/test/Lower/module_definition.f90 | 6 +-- flang/test/Lower/module_use.f90 | 12 ++--- flang/test/Lower/module_use_in_same_file.f90 | 18 +++---- flang/test/Lower/namelist-common-block.f90 | 2 +- flang/test/Lower/pointer-assignments.f90 | 2 +- flang/test/Lower/pointer-initial-target-2.f90 | 16 +++---- 32 files changed, 167 insertions(+), 79 deletions(-) create mode 100644 flang/test/Lower/HLFIR/common-block-bindc-conflicts.f90 diff --git a/flang/include/flang/Common/Fortran.h b/flang/include/flang/Common/Fortran.h index 59d82744fea71..df47e98150ce6 100644 --- a/flang/include/flang/Common/Fortran.h +++ b/flang/include/flang/Common/Fortran.h @@ -109,5 +109,7 @@ std::string AsFortran(IgnoreTKRSet); bool AreCompatibleCUDADataAttrs( std::optional, std::optional, IgnoreTKRSet); +static constexpr char blankCommonObjectName[] = "__BLNK__"; + } // namespace Fortran::common #endif // FORTRAN_COMMON_FORTRAN_H_ diff --git a/flang/include/flang/Lower/LoweringOptions.def b/flang/include/flang/Lower/LoweringOptions.def index 0ab7c5220d24c..7fb75f79bfc16 100644 --- a/flang/include/flang/Lower/LoweringOptions.def +++ b/flang/include/flang/Lower/LoweringOptions.def @@ -34,5 +34,8 @@ ENUM_LOWERINGOPT(LowerToHighLevelFIR, unsigned, 1, 0) /// If true, reverse PowerPC native vector element order. ENUM_LOWERINGOPT(NoPPCNativeVecElemOrder, unsigned, 1, 0) +/// If true, assume external names will be suffixed with an underscore. On by default. +ENUM_LOWERINGOPT(Underscoring, unsigned, 1, 1) + #undef LOWERINGOPT #undef ENUM_LOWERINGOPT diff --git a/flang/include/flang/Lower/Mangler.h b/flang/include/flang/Lower/Mangler.h index 1f3109b354191..9eb4e3e853a9e 100644 --- a/flang/include/flang/Lower/Mangler.h +++ b/flang/include/flang/Lower/Mangler.h @@ -43,9 +43,11 @@ using ScopeBlockIdMap = /// a symbol where all the Fortran context is needed. Otherwise, external /// symbols are mangled outside of any scope. std::string mangleName(const semantics::Symbol &, ScopeBlockIdMap &, - bool keepExternalInScope = false); + bool keepExternalInScope = false, + bool underscoring = true); std::string mangleName(const semantics::Symbol &, - bool keepExternalInScope = false); + bool keepExternalInScope = false, + bool underscoring = true); /// Convert a derived type instance to an internal name. std::string mangleName(const semantics::DerivedTypeSpec &, ScopeBlockIdMap &); diff --git a/flang/include/flang/Semantics/semantics.h b/flang/include/flang/Semantics/semantics.h index 7808eb6c79c07..4e8b71fa652f5 100644 --- a/flang/include/flang/Semantics/semantics.h +++ b/flang/include/flang/Semantics/semantics.h @@ -93,6 +93,7 @@ class SemanticsContext { } const std::string &moduleDirectory() const { return moduleDirectory_; } const std::string &moduleFileSuffix() const { return moduleFileSuffix_; } + bool underscoring() const { return underscoring_; } bool warningsAreErrors() const { return warningsAreErrors_; } bool debugModuleWriter() const { return debugModuleWriter_; } const evaluate::IntrinsicProcTable &intrinsics() const { return intrinsics_; } @@ -130,6 +131,10 @@ class SemanticsContext { moduleFileSuffix_ = x; return *this; } + SemanticsContext &set_underscoring(bool x) { + underscoring_ = x; + return *this; + } SemanticsContext &set_warnOnNonstandardUsage(bool x) { warnOnNonstandardUsage_ = x; return *this; @@ -262,6 +267,7 @@ class SemanticsContext { std::vector intrinsicModuleDirectories_; std::string moduleDirectory_{"."s}; std::string moduleFileSuffix_{".mod"}; + bool underscoring_{true}; bool warnOnNonstandardUsage_{false}; bool warningsAreErrors_{false}; bool debugModuleWriter_{false}; diff --git a/flang/include/flang/Semantics/tools.h b/flang/include/flang/Semantics/tools.h index 02d1a40a03c95..5bcb96e6050fa 100644 --- a/flang/include/flang/Semantics/tools.h +++ b/flang/include/flang/Semantics/tools.h @@ -683,5 +683,8 @@ std::optional GetConstExpr( // Returns "m" for a module, "m:sm" for a submodule. std::string GetModuleOrSubmoduleName(const Symbol &); +// Return the assembly name emitted for a common block. +std::string GetCommonBlockObjectName(const Symbol &, bool underscoring); + } // namespace Fortran::semantics #endif // FORTRAN_SEMANTICS_TOOLS_H_ diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 81bf89b1a44e5..dba2ac1a335f9 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -1237,7 +1237,8 @@ void CompilerInvocation::setSemanticsOpts( .set_searchDirectories(fortranOptions.searchDirectories) .set_intrinsicModuleDirectories(fortranOptions.intrinsicModuleDirectories) .set_warningsAreErrors(getWarnAsErr()) - .set_moduleFileSuffix(getModuleFileSuffix()); + .set_moduleFileSuffix(getModuleFileSuffix()) + .set_underscoring(getCodeGenOpts().Underscoring); llvm::Triple targetTriple{llvm::Triple(this->targetOpts.triple)}; // FIXME: Handle real(3) ? @@ -1262,6 +1263,7 @@ void CompilerInvocation::setLoweringOptions() { // Lower TRANSPOSE as a runtime call under -O0. loweringOpts.setOptimizeTranspose(codegenOpts.OptimizationLevel > 0); + loweringOpts.setUnderscoring(codegenOpts.Underscoring); const LangOptions &langOptions = getLangOpts(); Fortran::common::MathOptionsBase &mathOpts = loweringOpts.getMathOptions(); diff --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp index d7dec54c76de5..4c31b341c9702 100644 --- a/flang/lib/Lower/Bridge.cpp +++ b/flang/lib/Lower/Bridge.cpp @@ -836,7 +836,9 @@ class FirConverter : public Fortran::lower::AbstractConverter { } std::string mangleName(const Fortran::semantics::Symbol &symbol) override final { - return Fortran::lower::mangle::mangleName(symbol, scopeBlockIdMap); + return Fortran::lower::mangle::mangleName( + symbol, scopeBlockIdMap, /*keepExternalInScope=*/false, + getLoweringOptions().getUnderscoring()); } std::string mangleName( const Fortran::semantics::DerivedTypeSpec &derivedType) override final { diff --git a/flang/lib/Lower/Mangler.cpp b/flang/lib/Lower/Mangler.cpp index 4ea6238eded00..8e94ccfa70498 100644 --- a/flang/lib/Lower/Mangler.cpp +++ b/flang/lib/Lower/Mangler.cpp @@ -83,10 +83,9 @@ Fortran::lower::mangle::mangleName(std::string &name, } // Mangle the name of \p symbol to make it globally unique. -std::string -Fortran::lower::mangle::mangleName(const Fortran::semantics::Symbol &symbol, - ScopeBlockIdMap &scopeBlockIdMap, - bool keepExternalInScope) { +std::string Fortran::lower::mangle::mangleName( + const Fortran::semantics::Symbol &symbol, ScopeBlockIdMap &scopeBlockIdMap, + bool keepExternalInScope, bool underscoring) { // Resolve module and host associations before mangling. const auto &ultimateSymbol = symbol.GetUltimate(); @@ -167,11 +166,12 @@ Fortran::lower::mangle::mangleName(const Fortran::semantics::Symbol &symbol, symbolName); }, [&](const Fortran::semantics::CommonBlockDetails &) { - return fir::NameUniquer::doCommonBlock(symbolName); + return Fortran::semantics::GetCommonBlockObjectName(ultimateSymbol, + underscoring); }, [&](const Fortran::semantics::ProcBindingDetails &procBinding) { return mangleName(procBinding.symbol(), scopeBlockIdMap, - keepExternalInScope); + keepExternalInScope, underscoring); }, [&](const Fortran::semantics::DerivedTypeDetails &) -> std::string { // Derived type mangling must use mangleName(DerivedTypeSpec) so @@ -186,13 +186,14 @@ Fortran::lower::mangle::mangleName(const Fortran::semantics::Symbol &symbol, std::string Fortran::lower::mangle::mangleName(const Fortran::semantics::Symbol &symbol, - bool keepExternalInScope) { + bool keepExternalInScope, + bool underscoring) { assert((symbol.owner().kind() != Fortran::semantics::Scope::Kind::BlockConstruct || symbol.has()) && "block object mangling must specify a scopeBlockIdMap"); ScopeBlockIdMap scopeBlockIdMap; - return mangleName(symbol, scopeBlockIdMap, keepExternalInScope); + return mangleName(symbol, scopeBlockIdMap, keepExternalInScope, underscoring); } std::string Fortran::lower::mangle::mangleName( diff --git a/flang/lib/Optimizer/Transforms/ExternalNameConversion.cpp b/flang/lib/Optimizer/Transforms/ExternalNameConversion.cpp index 67756766fb355..64791d673dacd 100644 --- a/flang/lib/Optimizer/Transforms/ExternalNameConversion.cpp +++ b/flang/lib/Optimizer/Transforms/ExternalNameConversion.cpp @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// +#include "flang/Common/Fortran.h" #include "flang/Optimizer/Dialect/FIRDialect.h" #include "flang/Optimizer/Dialect/FIROps.h" #include "flang/Optimizer/Support/InternalNames.h" @@ -36,7 +37,7 @@ mangleExternalName(const std::pair commonBlocks_; + + std::map commonBlocks_; }; SemanticsContext::SemanticsContext( diff --git a/flang/lib/Semantics/tools.cpp b/flang/lib/Semantics/tools.cpp index 7c523971e8e24..54047f9c8d0a3 100644 --- a/flang/lib/Semantics/tools.cpp +++ b/flang/lib/Semantics/tools.cpp @@ -1655,4 +1655,15 @@ std::string GetModuleOrSubmoduleName(const Symbol &symbol) { return result; } +std::string GetCommonBlockObjectName(const Symbol &common, bool underscoring) { + if (const std::string * bind{common.GetBindName()}) { + return *bind; + } + if (common.name().empty()) { + return Fortran::common::blankCommonObjectName; + } + return underscoring ? common.name().ToString() + "_"s + : common.name().ToString(); +} + } // namespace Fortran::semantics diff --git a/flang/test/Lower/HLFIR/common-block-bindc-conflicts.f90 b/flang/test/Lower/HLFIR/common-block-bindc-conflicts.f90 new file mode 100644 index 0000000000000..07259539d851d --- /dev/null +++ b/flang/test/Lower/HLFIR/common-block-bindc-conflicts.f90 @@ -0,0 +1,47 @@ +! Test the mixing BIND(C) and non BIND(C) common blocks. + +! RUN: %flang_fc1 -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=UNDERSCORING +! RUN: %flang_fc1 -emit-llvm -fno-underscoring %s -o - 2>&1 | FileCheck %s --check-prefix=NO-UNDERSCORING + +! Scenario 1: Fortran symbols collide, but not the object file names, emit different +! globals for each common +subroutine bindc_common_with_same_fortran_name() + real :: x + common /com1/ x + bind(c, name="not_com1") :: /com1/ + print *, x +end subroutine + +subroutine bindc_common_with_same_fortran_name_2() + real :: x(2), y(2) + common /com1/ x + print *, x +end subroutine + +! Scenario 2: object file names of common block may collide (depending on +! underscoring option). Merge common block into a single global symbol. +subroutine bindc_common_colliding_with_normal_common() + real :: x, y + common /com3/ x + common /com4/ y + bind(c, name="some_common_") :: /com3/ + bind(c, name="__BLNK__") :: /com4/ + print *, x, y +end subroutine +subroutine bindc_common_colliding_with_normal_common_2() + real :: x(2), y(2) + common /some_common/ x + common // y + print *, x, y +end subroutine + +! UNDERSCORING: @__BLNK__ = common global [8 x i8] zeroinitializer +! UNDERSCORING: @com1_ = common global [8 x i8] zeroinitializer +! UNDERSCORING: @not_com1 = common global [4 x i8] zeroinitializer +! UNDERSCORING: @some_common_ = common global [8 x i8] zeroinitializer + +! NO-UNDERSCORING: @__BLNK__ = common global [8 x i8] zeroinitializer +! NO-UNDERSCORING: @com1 = common global [8 x i8] zeroinitializer +! NO-UNDERSCORING: @not_com1 = common global [4 x i8] zeroinitializer +! NO-UNDERSCORING: @some_common = common global [8 x i8] zeroinitializer +! NO-UNDERSCORING: @some_common_ = common global [4 x i8] zeroinitializer diff --git a/flang/test/Lower/OpenMP/copyin.f90 b/flang/test/Lower/OpenMP/copyin.f90 index 5c76a4f15b73d..ddfa0ea091462 100644 --- a/flang/test/Lower/OpenMP/copyin.f90 +++ b/flang/test/Lower/OpenMP/copyin.f90 @@ -207,7 +207,7 @@ subroutine combined_parallel_sections() !CHECK: func.func @_QPcommon_1() { -!CHECK: %[[val_0:.*]] = fir.address_of(@_QCc) : !fir.ref> +!CHECK: %[[val_0:.*]] = fir.address_of(@c_) : !fir.ref> !CHECK: %[[val_1:.*]] = omp.threadprivate %[[val_0]] : !fir.ref> -> !fir.ref> !CHECK: %[[val_2:.*]] = fir.convert %[[val_1]] : (!fir.ref>) -> !fir.ref> !CHECK: %[[val_c0:.*]] = arith.constant 0 : index @@ -258,7 +258,7 @@ subroutine common_1() !CHECK: func.func @_QPcommon_2() { !CHECK: %[[val_0:.*]] = fir.alloca i32 {bindc_name = "i", uniq_name = "_QFcommon_2Ei"} -!CHECK: %[[val_1:.*]] = fir.address_of(@_QCd) : !fir.ref> +!CHECK: %[[val_1:.*]] = fir.address_of(@d_) : !fir.ref> !CHECK: %[[val_2:.*]] = omp.threadprivate %[[val_1]] : !fir.ref> -> !fir.ref> !CHECK: %[[val_3:.*]] = fir.convert %[[val_2]] : (!fir.ref>) -> !fir.ref> !CHECK: %[[val_c0:.*]] = arith.constant 0 : index diff --git a/flang/test/Lower/OpenMP/declare-target-data.f90 b/flang/test/Lower/OpenMP/declare-target-data.f90 index 2897c9762923e..e57d928f5497a 100644 --- a/flang/test/Lower/OpenMP/declare-target-data.f90 +++ b/flang/test/Lower/OpenMP/declare-target-data.f90 @@ -52,19 +52,19 @@ module test_0 end module test_0 PROGRAM commons - !CHECK-DAG: fir.global @_QCnumbers {omp.declare_target = #omp.declaretarget} : tuple { + !CHECK-DAG: fir.global @numbers_ {omp.declare_target = #omp.declaretarget} : tuple { REAL :: one = 1 REAL :: two = 2 COMMON /numbers/ one, two !$omp declare target(/numbers/) - !CHECK-DAG: fir.global @_QCnumbers_link {omp.declare_target = #omp.declaretarget} : tuple { + !CHECK-DAG: fir.global @numbers_link_ {omp.declare_target = #omp.declaretarget} : tuple { REAL :: one_link = 1 REAL :: two_link = 2 COMMON /numbers_link/ one_link, two_link !$omp declare target link(/numbers_link/) - !CHECK-DAG: fir.global @_QCnumbers_to {omp.declare_target = #omp.declaretarget} : tuple { + !CHECK-DAG: fir.global @numbers_to_ {omp.declare_target = #omp.declaretarget} : tuple { REAL :: one_to = 1 REAL :: two_to = 2 COMMON /numbers_to/ one_to, two_to diff --git a/flang/test/Lower/OpenMP/firstprivate-commonblock.f90 b/flang/test/Lower/OpenMP/firstprivate-commonblock.f90 index 9b1759555c6bb..a230c8ab64c30 100644 --- a/flang/test/Lower/OpenMP/firstprivate-commonblock.f90 +++ b/flang/test/Lower/OpenMP/firstprivate-commonblock.f90 @@ -1,7 +1,7 @@ ! RUN: %flang_fc1 -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s !CHECK: func.func @_QPfirstprivate_common() { -!CHECK: %[[val_0:.*]] = fir.address_of(@_QCc) : !fir.ref> +!CHECK: %[[val_0:.*]] = fir.address_of(@c_) : !fir.ref> !CHECK: %[[val_1:.*]] = fir.convert %[[val_0]] : (!fir.ref>) -> !fir.ref> !CHECK: %[[val_c0:.*]] = arith.constant 0 : index !CHECK: %[[val_2:.*]] = fir.coordinate_of %[[val_1]], %[[val_c0]] : (!fir.ref>, index) -> !fir.ref diff --git a/flang/test/Lower/OpenMP/lastprivate-commonblock.f90 b/flang/test/Lower/OpenMP/lastprivate-commonblock.f90 index 73175cbd45623..06f3e1ca82234 100644 --- a/flang/test/Lower/OpenMP/lastprivate-commonblock.f90 +++ b/flang/test/Lower/OpenMP/lastprivate-commonblock.f90 @@ -3,7 +3,7 @@ !CHECK: func.func @_QPlastprivate_common() { !CHECK: %[[val_0:.*]] = fir.alloca i32 {adapt.valuebyref, pinned} !CHECK: %[[val_1:.*]] = fir.alloca i32 {bindc_name = "i", uniq_name = "_QFlastprivate_commonEi"} -!CHECK: %[[val_2:.*]] = fir.address_of(@_QCc) : !fir.ref> +!CHECK: %[[val_2:.*]] = fir.address_of(@c_) : !fir.ref> !CHECK: %[[val_3:.*]] = fir.convert %[[val_2]] : (!fir.ref>) -> !fir.ref> !CHECK: %[[val_c0:.*]] = arith.constant 0 : index !CHECK: %[[val_4:.*]] = fir.coordinate_of %[[val_3]], %[[val_c0]] : (!fir.ref>, index) -> !fir.ref diff --git a/flang/test/Lower/OpenMP/private-commonblock.f90 b/flang/test/Lower/OpenMP/private-commonblock.f90 index 644453a691318..767458e3effbf 100644 --- a/flang/test/Lower/OpenMP/private-commonblock.f90 +++ b/flang/test/Lower/OpenMP/private-commonblock.f90 @@ -15,7 +15,7 @@ subroutine private_common !$omp end parallel end subroutine -!CHECK: %[[val_0:.*]] = fir.address_of(@_QCblk) : !fir.ref> +!CHECK: %[[val_0:.*]] = fir.address_of(@blk_) : !fir.ref> !CHECK: %[[val_1:.*]] = fir.convert %0 : (!fir.ref>) -> !fir.ref> !CHECK: %[[val_c0:.*]] = arith.constant 0 : index !CHECK: %[[val_2:.*]] = fir.coordinate_of %[[val_1]], %[[val_c0]] : (!fir.ref>, index) -> !fir.ref @@ -72,7 +72,7 @@ subroutine private_clause_commonblock() end subroutine !CHECK: func.func @_QPprivate_clause_commonblock_pointer() { -!CHECK: %[[val_0:.*]] = fir.address_of(@_QCblk) : !fir.ref> +!CHECK: %[[val_0:.*]] = fir.address_of(@blk_) : !fir.ref> !CHECK: %[[val_1:.*]] = fir.convert %[[val_0]] : (!fir.ref>) -> !fir.ref> !CHECK: %[[val_c24:.*]] = arith.constant 24 : index !CHECK: %[[val_2:.*]] = fir.coordinate_of %[[val_1]], %[[val_c24]] : (!fir.ref>, index) -> !fir.ref diff --git a/flang/test/Lower/OpenMP/threadprivate-common-block-hlfir.f90 b/flang/test/Lower/OpenMP/threadprivate-common-block-hlfir.f90 index 29e3e277dc896..e9cad51534d01 100644 --- a/flang/test/Lower/OpenMP/threadprivate-common-block-hlfir.f90 +++ b/flang/test/Lower/OpenMP/threadprivate-common-block-hlfir.f90 @@ -5,7 +5,7 @@ !RUN: bbc -hlfir -emit-hlfir -fopenmp %s -o - | FileCheck %s -!CHECK: %[[CBLK_ADDR:.*]] = fir.address_of(@_QCblk) : !fir.ref> +!CHECK: %[[CBLK_ADDR:.*]] = fir.address_of(@blk_) : !fir.ref> !CHECK: {{.*}} = omp.threadprivate %[[CBLK_ADDR]] : !fir.ref> -> !fir.ref> !CHECK: omp.parallel { !CHECK: %[[TP_PARALLEL:.*]] = omp.threadprivate %[[CBLK_ADDR]] : !fir.ref> -> !fir.ref> diff --git a/flang/test/Lower/OpenMP/threadprivate-commonblock.f90 b/flang/test/Lower/OpenMP/threadprivate-commonblock.f90 index 5cecb372e630b..0a1252d881605 100644 --- a/flang/test/Lower/OpenMP/threadprivate-commonblock.f90 +++ b/flang/test/Lower/OpenMP/threadprivate-commonblock.f90 @@ -12,11 +12,11 @@ module test !$omp threadprivate(/blk/) -!CHECK: fir.global common @_QCblk(dense<0> : vector<103xi8>) : !fir.array<103xi8> +!CHECK: fir.global common @blk_(dense<0> : vector<103xi8>) : !fir.array<103xi8> contains subroutine sub() -!CHECK: [[ADDR0:%.*]] = fir.address_of(@_QCblk) : !fir.ref> +!CHECK: [[ADDR0:%.*]] = fir.address_of(@blk_) : !fir.ref> !CHECK: [[NEWADDR0:%.*]] = omp.threadprivate [[ADDR0]] : !fir.ref> -> !fir.ref> !CHECK-DAG: [[ADDR1:%.*]] = fir.convert [[NEWADDR0]] : (!fir.ref>) -> !fir.ref> !CHECK-DAG: [[C0:%.*]] = arith.constant 0 : index diff --git a/flang/test/Lower/OpenMP/threadprivate-use-association.f90 b/flang/test/Lower/OpenMP/threadprivate-use-association.f90 index 2a4649259d36f..71d454bb39ce1 100644 --- a/flang/test/Lower/OpenMP/threadprivate-use-association.f90 +++ b/flang/test/Lower/OpenMP/threadprivate-use-association.f90 @@ -3,7 +3,7 @@ !RUN: %flang_fc1 -emit-fir -fopenmp %s -o - | FileCheck %s -!CHECK-DAG: fir.global common @_QCblk(dense<0> : vector<24xi8>) : !fir.array<24xi8> +!CHECK-DAG: fir.global common @blk_(dense<0> : vector<24xi8>) : !fir.array<24xi8> !CHECK-DAG: fir.global @_QMtestEy : f32 { module test @@ -16,7 +16,7 @@ module test contains subroutine sub() ! CHECK-LABEL: @_QMtestPsub -!CHECK-DAG: [[ADDR0:%.*]] = fir.address_of(@_QCblk) : !fir.ref> +!CHECK-DAG: [[ADDR0:%.*]] = fir.address_of(@blk_) : !fir.ref> !CHECK-DAG: [[NEWADDR0:%.*]] = omp.threadprivate [[ADDR0]] : !fir.ref> -> !fir.ref> !CHECK-DAG: [[ADDR1:%.*]] = fir.address_of(@_QMtestEy) : !fir.ref !CHECK-DAG: [[NEWADDR1:%.*]] = omp.threadprivate [[ADDR1]] : !fir.ref -> !fir.ref @@ -49,9 +49,9 @@ program main call sub() ! CHECK-LABEL: @_QQmain() -!CHECK-DAG: [[ADDR0:%.*]] = fir.address_of(@_QCblk) : !fir.ref> +!CHECK-DAG: [[ADDR0:%.*]] = fir.address_of(@blk_) : !fir.ref> !CHECK-DAG: [[NEWADDR0:%.*]] = omp.threadprivate [[ADDR0]] : !fir.ref> -> !fir.ref> -!CHECK-DAG: [[ADDR1:%.*]] = fir.address_of(@_QCblk) : !fir.ref> +!CHECK-DAG: [[ADDR1:%.*]] = fir.address_of(@blk_) : !fir.ref> !CHECK-DAG: [[NEWADDR1:%.*]] = omp.threadprivate [[ADDR1]] : !fir.ref> -> !fir.ref> !CHECK-DAG: [[ADDR2:%.*]] = fir.address_of(@_QMtestEy) : !fir.ref !CHECK-DAG: [[NEWADDR2:%.*]] = omp.threadprivate [[ADDR2]] : !fir.ref -> !fir.ref diff --git a/flang/test/Lower/array.f90 b/flang/test/Lower/array.f90 index 852f560589280..e6e1286285838 100644 --- a/flang/test/Lower/array.f90 +++ b/flang/test/Lower/array.f90 @@ -1,6 +1,6 @@ ! RUN: bbc -o - %s | FileCheck %s -! CHECK-LABEL: fir.global @_QCblock +! CHECK-LABEL: fir.global @block_ ! CHECK-DAG: %[[VAL_1:.*]] = arith.constant 1.000000e+00 : f32 ! CHECK-DAG: %[[VAL_2:.*]] = arith.constant 2.400000e+00 : f32 ! CHECK-DAG: %[[VAL_3:.*]] = arith.constant 0.000000e+00 : f32 diff --git a/flang/test/Lower/common-block-2.f90 b/flang/test/Lower/common-block-2.f90 index 80bb7411bb4f8..31916f4be9fcb 100644 --- a/flang/test/Lower/common-block-2.f90 +++ b/flang/test/Lower/common-block-2.f90 @@ -5,12 +5,12 @@ ! - A blank common that is initialized ! - A common block that is initialized outside of a BLOCK DATA. -! CHECK-LABEL: fir.global @_QC : tuple> { +! CHECK-LABEL: fir.global @__BLNK__ : tuple> { ! CHECK: %[[undef:.*]] = fir.undefined tuple> ! CHECK: %[[init:.*]] = fir.insert_value %[[undef]], %c42{{.*}}, [0 : index] : (tuple>, i32) -> tuple> ! CHECK: fir.has_value %[[init]] : tuple> -! CHECK-LABEL: fir.global @_QCa : tuple> { +! CHECK-LABEL: fir.global @a_ : tuple> { ! CHECK: %[[undef:.*]] = fir.undefined tuple> ! CHECK: %[[init:.*]] = fir.insert_value %[[undef]], %c42{{.*}}, [0 : index] : (tuple>, i32) -> tuple> ! CHECK: fir.has_value %[[init]] : tuple> diff --git a/flang/test/Lower/common-block.f90 b/flang/test/Lower/common-block.f90 index a09181bfd78f0..bd3fab507c0ef 100644 --- a/flang/test/Lower/common-block.f90 +++ b/flang/test/Lower/common-block.f90 @@ -1,18 +1,18 @@ ! RUN: bbc %s -o - | tco | FileCheck %s ! RUN: %flang -emit-llvm -S -mmlir -disable-external-name-interop %s -o - | FileCheck %s -! CHECK: @_QC = common global [8 x i8] zeroinitializer -! CHECK: @_QCrien = common global [1 x i8] zeroinitializer -! CHECK: @_QCwith_empty_equiv = common global [8 x i8] zeroinitializer -! CHECK: @_QCx = global { float, float } { float 1.0{{.*}}, float 2.0{{.*}} } -! CHECK: @_QCy = common global [12 x i8] zeroinitializer -! CHECK: @_QCz = global { i32, [4 x i8], float } { i32 42, [4 x i8] undef, float 3.000000e+00 } +! CHECK: @__BLNK__ = common global [8 x i8] zeroinitializer +! CHECK: @rien_ = common global [1 x i8] zeroinitializer +! CHECK: @with_empty_equiv_ = common global [8 x i8] zeroinitializer +! CHECK: @x_ = global { float, float } { float 1.0{{.*}}, float 2.0{{.*}} } +! CHECK: @y_ = common global [12 x i8] zeroinitializer +! CHECK: @z_ = global { i32, [4 x i8], float } { i32 42, [4 x i8] undef, float 3.000000e+00 } ! CHECK-LABEL: _QPs0 subroutine s0 common // a0, b0 - ! CHECK: call void @_QPs(ptr @_QC, ptr getelementptr (i8, ptr @_QC, i64 4)) + ! CHECK: call void @_QPs(ptr @__BLNK__, ptr getelementptr (i8, ptr @__BLNK__, i64 4)) call s(a0, b0) end subroutine s0 @@ -21,7 +21,7 @@ subroutine s1 common /x/ a1, b1 data a1 /1.0/, b1 /2.0/ - ! CHECK: call void @_QPs(ptr @_QCx, ptr getelementptr (i8, ptr @_QCx, i64 4)) + ! CHECK: call void @_QPs(ptr @x_, ptr getelementptr (i8, ptr @x_, i64 4)) call s(a1, b1) end subroutine s1 @@ -29,7 +29,7 @@ end subroutine s1 subroutine s2 common /y/ a2, b2, c2 - ! CHECK: call void @_QPs(ptr @_QCy, ptr getelementptr (i8, ptr @_QCy, i64 4)) + ! CHECK: call void @_QPs(ptr @y_, ptr getelementptr (i8, ptr @y_, i64 4)) call s(a2, b2) end subroutine s2 @@ -54,9 +54,9 @@ module mod_with_common ! CHECK-LABEL: _QPs4 subroutine s4 use mod_with_common - ! CHECK: load i32, ptr @_QCc_in_mod + ! CHECK: load i32, ptr @c_in_mod_ print *, i - ! CHECK: load i32, ptr getelementptr (i8, ptr @_QCc_in_mod, i64 4) + ! CHECK: load i32, ptr getelementptr (i8, ptr @c_in_mod_, i64 4) print *, j end subroutine s4 diff --git a/flang/test/Lower/equivalence-2.f90 b/flang/test/Lower/equivalence-2.f90 index e53f265c63045..36a7c10ba2e93 100644 --- a/flang/test/Lower/equivalence-2.f90 +++ b/flang/test/Lower/equivalence-2.f90 @@ -111,7 +111,7 @@ subroutine eq_and_comm_same_offset equivalence(arr3,arr4) ! CHECK: %[[arr4Store:.*]] = fir.alloca !fir.array<70756xi8> {uniq_name = "_QFeq_and_comm_same_offsetEarr3"} - ! CHECK: %[[mcbAddr:.*]] = fir.address_of(@_QCmy_common_block) : !fir.ref> + ! CHECK: %[[mcbAddr:.*]] = fir.address_of(@my_common_block_) : !fir.ref> ! CHECK: %[[mcbCast:.*]] = fir.convert %[[mcbAddr]] : (!fir.ref>) -> !fir.ref> ! CHECK: %[[c0:.*]] = arith.constant 0 : index ! CHECK: %[[mcbCoor:.*]] = fir.coordinate_of %[[mcbCast]], %[[c0]] : (!fir.ref>, index) -> !fir.ref diff --git a/flang/test/Lower/explicit-interface-results-2.f90 b/flang/test/Lower/explicit-interface-results-2.f90 index f77eb7157c237..64af605cf23a9 100644 --- a/flang/test/Lower/explicit-interface-results-2.f90 +++ b/flang/test/Lower/explicit-interface-results-2.f90 @@ -140,7 +140,7 @@ subroutine host7() common /mycom/ n_common call takes_array(return_array()) ! CHECK: %[[VAL_0:.*]] = arith.constant 0 : index -! CHECK: %[[VAL_2:.*]] = fir.address_of(@_QCmycom) : !fir.ref> +! CHECK: %[[VAL_2:.*]] = fir.address_of(@mycom_) : !fir.ref> ! CHECK: %[[VAL_3:.*]] = fir.convert %[[VAL_2]] : (!fir.ref>) -> !fir.ref> ! CHECK: %[[VAL_4:.*]] = fir.coordinate_of %[[VAL_3]], %[[VAL_0]] : (!fir.ref>, index) -> !fir.ref ! CHECK: %[[VAL_5:.*]] = fir.convert %[[VAL_4]] : (!fir.ref) -> !fir.ref @@ -162,7 +162,7 @@ subroutine host8() implicit none call takes_array(return_array()) ! CHECK: %[[VAL_0:.*]] = arith.constant 0 : index -! CHECK: %[[VAL_1:.*]] = fir.address_of(@_QCmycom) : !fir.ref> +! CHECK: %[[VAL_1:.*]] = fir.address_of(@mycom_) : !fir.ref> ! CHECK: %[[VAL_2:.*]] = fir.convert %[[VAL_1]] : (!fir.ref>) -> !fir.ref> ! CHECK: %[[VAL_3:.*]] = fir.coordinate_of %[[VAL_2]], %[[VAL_0]] : (!fir.ref>, index) -> !fir.ref ! CHECK: %[[VAL_4:.*]] = fir.convert %[[VAL_3]] : (!fir.ref) -> !fir.ref @@ -190,7 +190,7 @@ subroutine host9() ! CHECK-LABEL: func @_QFhost9Pinternal_proc_a subroutine internal_proc_a() ! CHECK: %[[VAL_0:.*]] = arith.constant 0 : index -! CHECK: %[[VAL_1:.*]] = fir.address_of(@_QCmycom) : !fir.ref> +! CHECK: %[[VAL_1:.*]] = fir.address_of(@mycom_) : !fir.ref> ! CHECK: %[[VAL_2:.*]] = fir.convert %[[VAL_1]] : (!fir.ref>) -> !fir.ref> ! CHECK: %[[VAL_3:.*]] = fir.coordinate_of %[[VAL_2]], %[[VAL_0]] : (!fir.ref>, index) -> !fir.ref ! CHECK: %[[VAL_4:.*]] = fir.convert %[[VAL_3]] : (!fir.ref) -> !fir.ref @@ -217,7 +217,7 @@ subroutine host10() subroutine internal_proc_a() call takes_array(return_array()) ! CHECK: %[[VAL_0:.*]] = arith.constant 0 : index -! CHECK: %[[VAL_1:.*]] = fir.address_of(@_QCmycom) : !fir.ref> +! CHECK: %[[VAL_1:.*]] = fir.address_of(@mycom_) : !fir.ref> ! CHECK: %[[VAL_2:.*]] = fir.convert %[[VAL_1]] : (!fir.ref>) -> !fir.ref> ! CHECK: %[[VAL_3:.*]] = fir.coordinate_of %[[VAL_2]], %[[VAL_0]] : (!fir.ref>, index) -> !fir.ref ! CHECK: %[[VAL_4:.*]] = fir.convert %[[VAL_3]] : (!fir.ref) -> !fir.ref diff --git a/flang/test/Lower/host-associated-globals.f90 b/flang/test/Lower/host-associated-globals.f90 index 1f23b15fe3af4..018eb7aee3bc8 100644 --- a/flang/test/Lower/host-associated-globals.f90 +++ b/flang/test/Lower/host-associated-globals.f90 @@ -38,7 +38,7 @@ subroutine bar() end subroutine end subroutine ! CHECK-LABEL: func.func @_QFtest_commonPbar() attributes {fir.internal_proc} { -! CHECK: %[[VAL_0:.*]] = fir.address_of(@_QCx) : !fir.ref> +! CHECK: %[[VAL_0:.*]] = fir.address_of(@x_) : !fir.ref> ! CHECK: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref>) -> !fir.ref> ! CHECK: %[[VAL_2:.*]] = arith.constant 4 : index ! CHECK: %[[VAL_3:.*]] = fir.coordinate_of %[[VAL_1]], %[[VAL_2]] : (!fir.ref>, index) -> !fir.ref diff --git a/flang/test/Lower/module_definition.f90 b/flang/test/Lower/module_definition.f90 index f79bb4cf03f3e..fd3b89db7d20c 100644 --- a/flang/test/Lower/module_definition.f90 +++ b/flang/test/Lower/module_definition.f90 @@ -12,15 +12,15 @@ module modCommonNoInit1 real :: x_named1 common /named1/ x_named1 end module -! CHECK-LABEL: fir.global common @_QC(dense<0> : vector<4xi8>) : !fir.array<4xi8> -! CHECK-LABEL: fir.global common @_QCnamed1(dense<0> : vector<4xi8>) : !fir.array<4xi8> +! CHECK-LABEL: fir.global common @__BLNK__(dense<0> : vector<4xi8>) : !fir.array<4xi8> +! CHECK-LABEL: fir.global common @named1_(dense<0> : vector<4xi8>) : !fir.array<4xi8> ! Module defines variable in common block with initialization module modCommonInit1 integer :: i_named2 = 42 common /named2/ i_named2 end module -! CHECK-LABEL: fir.global @_QCnamed2 : tuple { +! CHECK-LABEL: fir.global @named2_ : tuple { ! CHECK: %[[init:.*]] = fir.insert_value %{{.*}}, %c42{{.*}}, [0 : index] : (tuple, i32) -> tuple ! CHECK: fir.has_value %[[init]] : tuple diff --git a/flang/test/Lower/module_use.f90 b/flang/test/Lower/module_use.f90 index c7f23c20ada9c..21458bb488430 100644 --- a/flang/test/Lower/module_use.f90 +++ b/flang/test/Lower/module_use.f90 @@ -5,9 +5,9 @@ ! The modules are defined in module_definition.f90 ! The first runs ensures the module file is generated. -! CHECK: fir.global common @_QC(dense<0> : vector<4xi8>) : !fir.array<4xi8> -! CHECK-NEXT: fir.global common @_QCnamed1(dense<0> : vector<4xi8>) : !fir.array<4xi8> -! CHECK-NEXT: fir.global common @_QCnamed2(dense<0> : vector<4xi8>) : !fir.array<4xi8> +! CHECK: fir.global common @__BLNK__(dense<0> : vector<4xi8>) : !fir.array<4xi8> +! CHECK-NEXT: fir.global common @named1_(dense<0> : vector<4xi8>) : !fir.array<4xi8> +! CHECK-NEXT: fir.global common @named2_(dense<0> : vector<4xi8>) : !fir.array<4xi8> ! CHECK-LABEL: func @_QPm1use() real function m1use() @@ -32,9 +32,9 @@ real function m1use() real function modCommon1Use() use modCommonInit1 use modCommonNoInit1 - ! CHECK-DAG: fir.address_of(@_QCnamed2) : !fir.ref> - ! CHECK-DAG: fir.address_of(@_QC) : !fir.ref> - ! CHECK-DAG: fir.address_of(@_QCnamed1) : !fir.ref> + ! CHECK-DAG: fir.address_of(@named2_) : !fir.ref> + ! CHECK-DAG: fir.address_of(@__BLNK__) : !fir.ref> + ! CHECK-DAG: fir.address_of(@named1_) : !fir.ref> modCommon1Use = x_blank + x_named1 + i_named2 end function diff --git a/flang/test/Lower/module_use_in_same_file.f90 b/flang/test/Lower/module_use_in_same_file.f90 index ea4ca3d0f7388..9e51bee14fd7a 100644 --- a/flang/test/Lower/module_use_in_same_file.f90 +++ b/flang/test/Lower/module_use_in_same_file.f90 @@ -79,26 +79,26 @@ module modCommon2 contains ! CHECK-LABEL: func @_QMmodcommon2Pfoo() real function foo() - ! CHECK-DAG: fir.address_of(@_QCnamed2) : !fir.ref> - ! CHECK-DAG: fir.address_of(@_QC) : !fir.ref> - ! CHECK-DAG: fir.address_of(@_QCnamed1) : !fir.ref> + ! CHECK-DAG: fir.address_of(@named2_) : !fir.ref> + ! CHECK-DAG: fir.address_of(@__BLNK__) : !fir.ref> + ! CHECK-DAG: fir.address_of(@named1_) : !fir.ref> foo = x_blank + x_named1(5) + i_named2 end function end module ! CHECK-LABEL: func @_QPmodcommon2use() real function modCommon2use() use modCommon2 - ! CHECK-DAG: fir.address_of(@_QCnamed2) : !fir.ref> - ! CHECK-DAG: fir.address_of(@_QC) : !fir.ref> - ! CHECK-DAG: fir.address_of(@_QCnamed1) : !fir.ref> + ! CHECK-DAG: fir.address_of(@named2_) : !fir.ref> + ! CHECK-DAG: fir.address_of(@__BLNK__) : !fir.ref> + ! CHECK-DAG: fir.address_of(@named1_) : !fir.ref> modCommon2use = x_blank + x_named1(5) + i_named2 end function ! CHECK-LABEL: func @_QPmodcommon2use_rename() real function modCommon2use_rename() use modCommon2, only : renamed0 => x_blank, renamed1 => x_named1, renamed2 => i_named2 - ! CHECK-DAG: fir.address_of(@_QCnamed2) : !fir.ref> - ! CHECK-DAG: fir.address_of(@_QC) : !fir.ref> - ! CHECK-DAG: fir.address_of(@_QCnamed1) : !fir.ref> + ! CHECK-DAG: fir.address_of(@named2_) : !fir.ref> + ! CHECK-DAG: fir.address_of(@__BLNK__) : !fir.ref> + ! CHECK-DAG: fir.address_of(@named1_) : !fir.ref> modCommon2use_rename = renamed0 + renamed1(5) + renamed2 end function diff --git a/flang/test/Lower/namelist-common-block.f90 b/flang/test/Lower/namelist-common-block.f90 index 39deb7b51059c..f47d4c9bd87ea 100644 --- a/flang/test/Lower/namelist-common-block.f90 +++ b/flang/test/Lower/namelist-common-block.f90 @@ -18,7 +18,7 @@ subroutine print_t() end ! CHECK-LABEL: fir.global linkonce @_QFNt.list constant : !fir.array<2xtuple, !fir.ref>>> { -! CHECK: %[[CB_ADDR:.*]] = fir.address_of(@_QCc) : !fir.ref> +! CHECK: %[[CB_ADDR:.*]] = fir.address_of(@c_) : !fir.ref> ! CHECK: %[[CB_CAST:.*]] = fir.convert %[[CB_ADDR]] : (!fir.ref>) -> !fir.ref> ! CHECK: %[[OFFSET:.*]] = arith.constant 8 : index ! CHECK: %[[COORD:.*]] = fir.coordinate_of %[[CB_CAST]], %[[OFFSET]] : (!fir.ref>, index) -> !fir.ref diff --git a/flang/test/Lower/pointer-assignments.f90 b/flang/test/Lower/pointer-assignments.f90 index 767a5121cffa4..24154d83e992c 100644 --- a/flang/test/Lower/pointer-assignments.f90 +++ b/flang/test/Lower/pointer-assignments.f90 @@ -364,7 +364,7 @@ subroutine issue1180(x) integer, target :: x integer, pointer :: p common /some_common/ p - ! CHECK: %[[VAL_1:.*]] = fir.address_of(@_QCsome_common) : !fir.ref> + ! CHECK: %[[VAL_1:.*]] = fir.address_of(@some_common_) : !fir.ref> ! CHECK: %[[VAL_2:.*]] = fir.convert %[[VAL_1]] : (!fir.ref>) -> !fir.ref> ! CHECK: %[[VAL_3:.*]] = arith.constant 0 : index ! CHECK: %[[VAL_4:.*]] = fir.coordinate_of %[[VAL_2]], %[[VAL_3]] : (!fir.ref>, index) -> !fir.ref diff --git a/flang/test/Lower/pointer-initial-target-2.f90 b/flang/test/Lower/pointer-initial-target-2.f90 index 2889d58d385c2..69e9f23126708 100644 --- a/flang/test/Lower/pointer-initial-target-2.f90 +++ b/flang/test/Lower/pointer-initial-target-2.f90 @@ -11,7 +11,7 @@ real, save, target :: b common /a/ p data p /b/ -! CHECK-LABEL: fir.global @_QCa : tuple>> +! CHECK-LABEL: fir.global @a_ : tuple>> ! CHECK: %[[undef:.*]] = fir.undefined tuple>> ! CHECK: %[[b:.*]] = fir.address_of(@_QEb) : !fir.ref ! CHECK: %[[box:.*]] = fir.embox %[[b]] : (!fir.ref) -> !fir.box @@ -29,10 +29,10 @@ block data tied real, pointer :: p2 => x1 common /c1/ x1, p1 common /c2/ x2, p2 -! CHECK-LABEL: fir.global @_QCc1 : tuple, !fir.box>> - ! CHECK: fir.address_of(@_QCc2) : !fir.ref, !fir.box>>> -! CHECK-LABEL: fir.global @_QCc2 : tuple, !fir.box>> - ! CHECK: fir.address_of(@_QCc1) : !fir.ref, !fir.box>>> +! CHECK-LABEL: fir.global @c1_ : tuple, !fir.box>> + ! CHECK: fir.address_of(@c2_) : !fir.ref, !fir.box>>> +! CHECK-LABEL: fir.global @c2_ : tuple, !fir.box>> + ! CHECK: fir.address_of(@c1_) : !fir.ref, !fir.box>>> end block data ! Test pointer in a common with initial target in the same common. @@ -40,9 +40,9 @@ block data bdsnake integer, target :: b = 42 integer, pointer :: p => b common /snake/ p, b -! CHECK-LABEL: fir.global @_QCsnake : tuple>, i32> +! CHECK-LABEL: fir.global @snake_ : tuple>, i32> ! CHECK: %[[tuple0:.*]] = fir.undefined tuple>, i32> - ! CHECK: %[[snakeAddr:.*]] = fir.address_of(@_QCsnake) : !fir.ref>, i32>> + ! CHECK: %[[snakeAddr:.*]] = fir.address_of(@snake_) : !fir.ref>, i32>> ! CHECK: %[[byteView:.*]] = fir.convert %[[snakeAddr:.*]] : (!fir.ref>, i32>>) -> !fir.ref> ! CHECK: %[[coor:.*]] = fir.coordinate_of %[[byteView]], %c24{{.*}} : (!fir.ref>, index) -> !fir.ref ! CHECK: %[[bAddr:.*]] = fir.convert %[[coor]] : (!fir.ref) -> !fir.ref @@ -72,7 +72,7 @@ module some_mod_2 save :: /com/ real, pointer :: p(:) => y ! CHECK-LABEL: fir.global @_QMsome_mod_2Ep : !fir.box>> { - ! CHECK: %[[c:.*]] = fir.address_of(@_QCcom) : !fir.ref> + ! CHECK: %[[c:.*]] = fir.address_of(@com_) : !fir.ref> ! CHECK: %[[com:.*]] = fir.convert %[[c]] : (!fir.ref>) -> !fir.ref> ! CHECK: %[[yRaw:.*]] = fir.coordinate_of %[[com]], %c400{{.*}} : (!fir.ref>, index) -> !fir.ref ! CHECK: %[[y:.*]] = fir.convert %[[yRaw]] : (!fir.ref) -> !fir.ref>