Skip to content

[flang][runtime] Don't use -1 in I/O API for "default unit" #76642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions flang/include/flang/Runtime/io-api.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "flang/Common/uint128.h"
#include "flang/Runtime/entry-names.h"
#include "flang/Runtime/iostat.h"
#include "flang/Runtime/magic-numbers.h"
#include <cinttypes>
#include <cstddef>

Expand All @@ -29,7 +30,9 @@ class IoStatementState;
using Cookie = IoStatementState *;
using ExternalUnit = int;
using AsynchronousId = int;
static constexpr ExternalUnit DefaultUnit{-1}; // READ(*), WRITE(*), PRINT

static constexpr ExternalUnit DefaultOutputUnit{FORTRAN_DEFAULT_OUTPUT_UNIT};
static constexpr ExternalUnit DefaultInputUnit{FORTRAN_DEFAULT_INPUT_UNIT};

// INQUIRE specifiers are encoded as simple base-26 packings of
// the spellings of their keywords.
Expand Down Expand Up @@ -57,7 +60,8 @@ extern "C" {

// These functions initiate data transfer statements (READ, WRITE, PRINT).
// Example: PRINT *, 666 is implemented as the series of calls:
// Cookie cookie{BeginExternalListOutput(DefaultUnit,__FILE__,__LINE__)};
// Cookie cookie{BeginExternalListOutput(DefaultOutputUnit,
// __FILE__, __LINE__)};
// OutputInteger32(cookie, 666);
// EndIoStatement(cookie);
// Formatted I/O with explicit formats can supply the format as a
Expand Down Expand Up @@ -135,19 +139,21 @@ enum Iostat IONAME(CheckUnitNumberInRange128)(common::int128_t unit,
const char *sourceFile = nullptr, int sourceLine = 0);

// External synchronous I/O initiation
Cookie IONAME(BeginExternalListOutput)(ExternalUnit = DefaultUnit,
Cookie IONAME(BeginExternalListOutput)(ExternalUnit = DefaultOutputUnit,
const char *sourceFile = nullptr, int sourceLine = 0);
Cookie IONAME(BeginExternalListInput)(ExternalUnit = DefaultUnit,
Cookie IONAME(BeginExternalListInput)(ExternalUnit = DefaultInputUnit,
const char *sourceFile = nullptr, int sourceLine = 0);
Cookie IONAME(BeginExternalFormattedOutput)(const char *format, std::size_t,
const Descriptor *formatDescriptor = nullptr, ExternalUnit = DefaultUnit,
const char *sourceFile = nullptr, int sourceLine = 0);
const Descriptor *formatDescriptor = nullptr,
ExternalUnit = DefaultOutputUnit, const char *sourceFile = nullptr,
int sourceLine = 0);
Cookie IONAME(BeginExternalFormattedInput)(const char *format, std::size_t,
const Descriptor *formatDescriptor = nullptr, ExternalUnit = DefaultUnit,
const char *sourceFile = nullptr, int sourceLine = 0);
Cookie IONAME(BeginUnformattedOutput)(ExternalUnit = DefaultUnit,
const Descriptor *formatDescriptor = nullptr,
ExternalUnit = DefaultInputUnit, const char *sourceFile = nullptr,
int sourceLine = 0);
Cookie IONAME(BeginUnformattedOutput)(ExternalUnit = DefaultOutputUnit,
const char *sourceFile = nullptr, int sourceLine = 0);
Cookie IONAME(BeginUnformattedInput)(ExternalUnit = DefaultUnit,
Cookie IONAME(BeginUnformattedInput)(ExternalUnit = DefaultInputUnit,
const char *sourceFile = nullptr, int sourceLine = 0);

// WAIT(ID=)
Expand Down Expand Up @@ -190,7 +196,7 @@ Cookie IONAME(BeginInquireIoLength)(
// This call makes the runtime library defer those particular error/end
// conditions to the EndIoStatement() call rather than terminating
// the image. E.g., for READ(*,*,END=666) A, B, (C(J),J=1,N)
// Cookie cookie{BeginExternalListInput(DefaultUnit,__FILE__,__LINE__)};
// Cookie cookie{BeginExternalListInput(DefaultInputUnit,__FILE__,__LINE__)};
// EnableHandlers(cookie, false, false, true /*END=*/, false);
// if (InputReal64(cookie, &A)) {
// if (InputReal64(cookie, &B)) {
Expand Down
4 changes: 4 additions & 0 deletions flang/include/flang/Runtime/magic-numbers.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ start at 100 so as to never conflict with those codes.
#ifndef FORTRAN_RUNTIME_MAGIC_NUMBERS_H_
#define FORTRAN_RUNTIME_MAGIC_NUMBERS_H_

#define FORTRAN_DEFAULT_OUTPUT_UNIT 6
#define FORTRAN_DEFAULT_INPUT_UNIT 5
#define FORTRAN_ERROR_UNIT 0

#define FORTRAN_RUNTIME_IOSTAT_END (-1)
#define FORTRAN_RUNTIME_IOSTAT_EOR (-2)
#define FORTRAN_RUNTIME_IOSTAT_FLUSH (-3)
Expand Down
27 changes: 15 additions & 12 deletions flang/lib/Lower/IO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1850,24 +1850,25 @@ static mlir::Value genIOUnit(Fortran::lower::AbstractConverter &converter,
mlir::Location loc,
const Fortran::parser::IoUnit *iounit,
mlir::Type ty, ConditionSpecInfo &csi,
Fortran::lower::StatementContext &stmtCtx) {
Fortran::lower::StatementContext &stmtCtx,
int defaultUnitNumber) {
auto &builder = converter.getFirOpBuilder();
if (iounit)
if (auto *e = std::get_if<Fortran::parser::FileUnitNumber>(&iounit->u))
return genIOUnitNumber(converter, loc, Fortran::semantics::GetExpr(*e),
ty, csi, stmtCtx);
return builder.create<mlir::arith::ConstantOp>(
loc, builder.getIntegerAttr(ty, Fortran::runtime::io::DefaultUnit));
loc, builder.getIntegerAttr(ty, defaultUnitNumber));
}

template <typename A>
static mlir::Value getIOUnit(Fortran::lower::AbstractConverter &converter,
mlir::Location loc, const A &stmt, mlir::Type ty,
ConditionSpecInfo &csi,
Fortran::lower::StatementContext &stmtCtx) {
static mlir::Value
getIOUnit(Fortran::lower::AbstractConverter &converter, mlir::Location loc,
const A &stmt, mlir::Type ty, ConditionSpecInfo &csi,
Fortran::lower::StatementContext &stmtCtx, int defaultUnitNumber) {
const Fortran::parser::IoUnit *iounit =
stmt.iounit ? &*stmt.iounit : getIOControl<Fortran::parser::IoUnit>(stmt);
return genIOUnit(converter, loc, iounit, ty, csi, stmtCtx);
return genIOUnit(converter, loc, iounit, ty, csi, stmtCtx, defaultUnitNumber);
}
//===----------------------------------------------------------------------===//
// Generators for each IO statement type.
Expand Down Expand Up @@ -2091,7 +2092,7 @@ getBeginDataTransferFunc(mlir::Location loc, fir::FirOpBuilder &builder,
}

/// Generate the arguments of a begin data transfer statement call.
template <bool hasIOCtrl, typename A>
template <bool hasIOCtrl, int defaultUnitNumber, typename A>
void genBeginDataTransferCallArgs(
llvm::SmallVectorImpl<mlir::Value> &ioArgs,
Fortran::lower::AbstractConverter &converter, mlir::Location loc,
Expand Down Expand Up @@ -2149,14 +2150,14 @@ void genBeginDataTransferCallArgs(
TODO(loc, "asynchronous");
maybeGetFormatArgs();
ioArgs.push_back(getIOUnit(converter, loc, stmt,
ioFuncTy.getInput(ioArgs.size()), csi,
stmtCtx));
ioFuncTy.getInput(ioArgs.size()), csi, stmtCtx,
defaultUnitNumber));
}
} else { // PRINT - maybe explicit format; default unit
maybeGetFormatArgs();
ioArgs.push_back(builder.create<mlir::arith::ConstantOp>(
loc, builder.getIntegerAttr(ioFuncTy.getInput(ioArgs.size()),
Fortran::runtime::io::DefaultUnit)));
defaultUnitNumber)));
}
// File name and line number are always the last two arguments.
ioArgs.push_back(
Expand Down Expand Up @@ -2193,7 +2194,9 @@ genDataTransferStmt(Fortran::lower::AbstractConverter &converter,
loc, builder, isFormatted, isList || isNml, isInternal,
isInternalWithDesc, isAsync);
llvm::SmallVector<mlir::Value> ioArgs;
genBeginDataTransferCallArgs<hasIOCtrl>(
genBeginDataTransferCallArgs<
hasIOCtrl, isInput ? Fortran::runtime::io::DefaultInputUnit
: Fortran::runtime::io::DefaultOutputUnit>(
ioArgs, converter, loc, stmt, ioFunc.getFunctionType(), isFormatted,
isList || isNml, isInternal, isAsync, descRef, csi, stmtCtx);
mlir::Value cookie =
Expand Down
7 changes: 4 additions & 3 deletions flang/module/iso_fortran_env.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
! See Fortran 2018, clause 16.10.2
! TODO: These are placeholder values so that some tests can be run.

include '../include/flang/Runtime/magic-numbers.h' ! IOSTAT values
include '../include/flang/Runtime/magic-numbers.h'

module iso_fortran_env

Expand Down Expand Up @@ -130,8 +130,9 @@ module iso_fortran_env

integer, parameter :: current_team = -1, initial_team = -2, parent_team = -3

integer, parameter :: input_unit = 5, output_unit = 6
integer, parameter :: error_unit = 0
integer, parameter :: output_unit = FORTRAN_DEFAULT_OUTPUT_UNIT
integer, parameter :: input_unit = FORTRAN_DEFAULT_INPUT_UNIT
integer, parameter :: error_unit = FORTRAN_ERROR_UNIT
integer, parameter :: iostat_end = FORTRAN_RUNTIME_IOSTAT_END
integer, parameter :: iostat_eor = FORTRAN_RUNTIME_IOSTAT_EOR
integer, parameter :: iostat_inquire_internal_unit = &
Expand Down
45 changes: 26 additions & 19 deletions flang/runtime/io-api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,6 @@ template <Direction DIR, template <Direction> class STATE, typename... A>
Cookie BeginExternalListIO(
int unitNumber, const char *sourceFile, int sourceLine, A &&...xs) {
Terminator terminator{sourceFile, sourceLine};
if (unitNumber == DefaultUnit) {
unitNumber = DIR == Direction::Input ? 5 : 6;
}
Cookie errorCookie{nullptr};
ExternalFileUnit *unit{GetOrCreateUnit(
unitNumber, DIR, false /*!unformatted*/, terminator, errorCookie)};
Expand Down Expand Up @@ -246,9 +243,6 @@ Cookie BeginExternalFormattedIO(const char *format, std::size_t formatLength,
const Descriptor *formatDescriptor, ExternalUnit unitNumber,
const char *sourceFile, int sourceLine) {
Terminator terminator{sourceFile, sourceLine};
if (unitNumber == DefaultUnit) {
unitNumber = DIR == Direction::Input ? 5 : 6;
}
Cookie errorCookie{nullptr};
ExternalFileUnit *unit{GetOrCreateUnit(
unitNumber, DIR, false /*!unformatted*/, terminator, errorCookie)};
Expand Down Expand Up @@ -761,7 +755,8 @@ bool IONAME(SetAccess)(Cookie cookie, const char *keyword, std::size_t length) {
IoStatementState &io{*cookie};
auto *open{io.get_if<OpenStatementState>()};
if (!open) {
if (!io.get_if<ErroneousIoStatementState>()) {
if (!io.get_if<NoopStatementState>() &&
!io.get_if<ErroneousIoStatementState>()) {
io.GetIoErrorHandler().Crash(
"SetAccess() called when not in an OPEN statement");
}
Expand Down Expand Up @@ -796,7 +791,8 @@ bool IONAME(SetAction)(Cookie cookie, const char *keyword, std::size_t length) {
IoStatementState &io{*cookie};
auto *open{io.get_if<OpenStatementState>()};
if (!open) {
if (!io.get_if<ErroneousIoStatementState>()) {
if (!io.get_if<NoopStatementState>() &&
!io.get_if<ErroneousIoStatementState>()) {
io.GetIoErrorHandler().Crash(
"SetAction() called when not in an OPEN statement");
}
Expand Down Expand Up @@ -852,7 +848,8 @@ bool IONAME(SetAsynchronous)(
handler.SignalError(IostatBadAsynchronous);
}
}
} else if (!io.get_if<ErroneousIoStatementState>()) {
} else if (!io.get_if<NoopStatementState>() &&
!io.get_if<ErroneousIoStatementState>()) {
handler.Crash("SetAsynchronous() called when not in an OPEN or external "
"I/O statement");
}
Expand All @@ -864,7 +861,8 @@ bool IONAME(SetCarriagecontrol)(
IoStatementState &io{*cookie};
auto *open{io.get_if<OpenStatementState>()};
if (!open) {
if (!io.get_if<ErroneousIoStatementState>()) {
if (!io.get_if<NoopStatementState>() &&
!io.get_if<ErroneousIoStatementState>()) {
io.GetIoErrorHandler().Crash(
"SetCarriageControl() called when not in an OPEN statement");
}
Expand Down Expand Up @@ -895,7 +893,8 @@ bool IONAME(SetConvert)(
IoStatementState &io{*cookie};
auto *open{io.get_if<OpenStatementState>()};
if (!open) {
if (!io.get_if<ErroneousIoStatementState>()) {
if (!io.get_if<NoopStatementState>() &&
!io.get_if<ErroneousIoStatementState>()) {
io.GetIoErrorHandler().Crash(
"SetConvert() called when not in an OPEN statement");
}
Expand All @@ -919,7 +918,8 @@ bool IONAME(SetEncoding)(
IoStatementState &io{*cookie};
auto *open{io.get_if<OpenStatementState>()};
if (!open) {
if (!io.get_if<ErroneousIoStatementState>()) {
if (!io.get_if<NoopStatementState>() &&
!io.get_if<ErroneousIoStatementState>()) {
io.GetIoErrorHandler().Crash(
"SetEncoding() called when not in an OPEN statement");
}
Expand Down Expand Up @@ -949,7 +949,8 @@ bool IONAME(SetForm)(Cookie cookie, const char *keyword, std::size_t length) {
IoStatementState &io{*cookie};
auto *open{io.get_if<OpenStatementState>()};
if (!open) {
if (!io.get_if<ErroneousIoStatementState>()) {
if (!io.get_if<NoopStatementState>() &&
!io.get_if<ErroneousIoStatementState>()) {
io.GetIoErrorHandler().Crash(
"SetForm() called when not in an OPEN statement");
}
Expand Down Expand Up @@ -977,7 +978,8 @@ bool IONAME(SetPosition)(
IoStatementState &io{*cookie};
auto *open{io.get_if<OpenStatementState>()};
if (!open) {
if (!io.get_if<ErroneousIoStatementState>()) {
if (!io.get_if<NoopStatementState>() &&
!io.get_if<ErroneousIoStatementState>()) {
io.GetIoErrorHandler().Crash(
"SetPosition() called when not in an OPEN statement");
}
Expand Down Expand Up @@ -1008,7 +1010,8 @@ bool IONAME(SetRecl)(Cookie cookie, std::size_t n) {
IoStatementState &io{*cookie};
auto *open{io.get_if<OpenStatementState>()};
if (!open) {
if (!io.get_if<ErroneousIoStatementState>()) {
if (!io.get_if<NoopStatementState>() &&
!io.get_if<ErroneousIoStatementState>()) {
io.GetIoErrorHandler().Crash(
"SetRecl() called when not in an OPEN statement");
}
Expand Down Expand Up @@ -1093,7 +1096,8 @@ bool IONAME(SetFile)(Cookie cookie, const char *path, std::size_t chars) {
}
open->set_path(path, chars);
return true;
} else if (!io.get_if<ErroneousIoStatementState>()) {
} else if (!io.get_if<NoopStatementState>() &&
!io.get_if<ErroneousIoStatementState>()) {
io.GetIoErrorHandler().Crash(
"SetFile() called when not in an OPEN statement");
}
Expand All @@ -1104,7 +1108,8 @@ bool IONAME(GetNewUnit)(Cookie cookie, int &unit, int kind) {
IoStatementState &io{*cookie};
auto *open{io.get_if<OpenStatementState>()};
if (!open) {
if (!io.get_if<ErroneousIoStatementState>()) {
if (!io.get_if<NoopStatementState>() &&
!io.get_if<ErroneousIoStatementState>()) {
io.GetIoErrorHandler().Crash(
"GetNewUnit() called when not in an OPEN statement");
}
Expand Down Expand Up @@ -1361,7 +1366,8 @@ std::size_t IONAME(GetSize)(Cookie cookie) {
if (const auto *formatted{
io.get_if<FormattedIoStatementState<Direction::Input>>()}) {
return formatted->GetEditDescriptorChars();
} else if (!io.get_if<ErroneousIoStatementState>()) {
} else if (!io.get_if<NoopStatementState>() &&
!io.get_if<ErroneousIoStatementState>()) {
handler.Crash("GetIoSize() called for an I/O statement that is not a "
"formatted READ()");
}
Expand All @@ -1376,7 +1382,8 @@ std::size_t IONAME(GetIoLength)(Cookie cookie) {
}
if (const auto *inq{io.get_if<InquireIOLengthState>()}) {
return inq->bytes();
} else if (!io.get_if<ErroneousIoStatementState>()) {
} else if (!io.get_if<NoopStatementState>() &&
!io.get_if<ErroneousIoStatementState>()) {
handler.Crash("GetIoLength() called for an I/O statement that is not "
"INQUIRE(IOLENGTH=)");
}
Expand Down
10 changes: 7 additions & 3 deletions flang/runtime/unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "lock.h"
#include "tools.h"
#include "unit-map.h"
#include "flang/Runtime/magic-numbers.h"
#include <cstdio>
#include <limits>
#include <utility>
Expand Down Expand Up @@ -220,21 +221,24 @@ UnitMap &ExternalFileUnit::CreateUnitMap() {
UnitMap &newUnitMap{*New<UnitMap>{terminator}().release()};

bool wasExtant{false};
ExternalFileUnit &out{*newUnitMap.LookUpOrCreate(6, terminator, wasExtant)};
ExternalFileUnit &out{*newUnitMap.LookUpOrCreate(
FORTRAN_DEFAULT_OUTPUT_UNIT, terminator, wasExtant)};
RUNTIME_CHECK(terminator, !wasExtant);
out.Predefine(1);
handler.SignalError(out.SetDirection(Direction::Output));
out.isUnformatted = false;
defaultOutput = &out;

ExternalFileUnit &in{*newUnitMap.LookUpOrCreate(5, terminator, wasExtant)};
ExternalFileUnit &in{*newUnitMap.LookUpOrCreate(
FORTRAN_DEFAULT_INPUT_UNIT, terminator, wasExtant)};
RUNTIME_CHECK(terminator, !wasExtant);
in.Predefine(0);
handler.SignalError(in.SetDirection(Direction::Input));
in.isUnformatted = false;
defaultInput = &in;

ExternalFileUnit &error{*newUnitMap.LookUpOrCreate(0, terminator, wasExtant)};
ExternalFileUnit &error{
*newUnitMap.LookUpOrCreate(FORTRAN_ERROR_UNIT, terminator, wasExtant)};
RUNTIME_CHECK(terminator, !wasExtant);
error.Predefine(2);
handler.SignalError(error.SetDirection(Direction::Output));
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/HLFIR/calls-f77.f90
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ subroutine return_char(n)
end subroutine
! CHECK-LABEL: func.func @_QPreturn_char(
! CHECK: %[[VAL_1:.*]]:2 = hlfir.declare {{.*}}n
! CHECK: %[[VAL_2:.*]] = arith.constant -1 : i32
! CHECK: %[[VAL_2:.*]] = arith.constant 6 : i32
! CHECK: %[[VAL_7:.*]] = fir.load %[[VAL_1]]#0 : !fir.ref<i64>
! CHECK: %[[VAL_8:.*]] = fir.convert %[[VAL_7]] : (i64) -> index
! CHECK: %[[VAL_9:.*]] = arith.constant 0 : index
Expand Down
4 changes: 2 additions & 2 deletions flang/test/Lower/HLFIR/convert-mbox-to-value.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ end subroutine test_int_allocatable
! CHECK-LABEL: func.func @_QPtest_int_allocatable(
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<!fir.box<!fir.heap<i32>>> {fir.bindc_name = "a"}) {
! CHECK: %[[VAL_1:.*]]:2 = hlfir.declare %[[VAL_0]] {fortran_attrs = #fir.var_attrs<allocatable>, uniq_name = "_QFtest_int_allocatableEa"} : (!fir.ref<!fir.box<!fir.heap<i32>>>) -> (!fir.ref<!fir.box<!fir.heap<i32>>>, !fir.ref<!fir.box<!fir.heap<i32>>>)
! CHECK: %[[VAL_2:.*]] = arith.constant -1 : i32
! CHECK: %[[VAL_2:.*]] = arith.constant 6 : i32
! CHECK: %[[VAL_3:.*]] = fir.address_of(@_QQclX{{.*}}) : !fir.ref<!fir.char<1,{{[0-9]*}}>>
! CHECK: %[[VAL_4:.*]] = fir.convert %[[VAL_3]] : (!fir.ref<!fir.char<1,{{[0-9]*}}>>) -> !fir.ref<i8>
! CHECK: %[[VAL_5:.*]] = arith.constant {{[0-9]*}} : i32
Expand All @@ -28,7 +28,7 @@ end subroutine test_int_pointer
! CHECK-LABEL: func.func @_QPtest_int_pointer(
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<!fir.box<!fir.ptr<i32>>> {fir.bindc_name = "p"}) {
! CHECK: %[[VAL_1:.*]]:2 = hlfir.declare %[[VAL_0]] {fortran_attrs = #fir.var_attrs<pointer>, uniq_name = "_QFtest_int_pointerEp"} : (!fir.ref<!fir.box<!fir.ptr<i32>>>) -> (!fir.ref<!fir.box<!fir.ptr<i32>>>, !fir.ref<!fir.box<!fir.ptr<i32>>>)
! CHECK: %[[VAL_2:.*]] = arith.constant -1 : i32
! CHECK: %[[VAL_2:.*]] = arith.constant 6 : i32
! CHECK: %[[VAL_3:.*]] = fir.address_of(@_QQclX{{.*}}) : !fir.ref<!fir.char<1,{{[0-9]*}}>>
! CHECK: %[[VAL_4:.*]] = fir.convert %[[VAL_3]] : (!fir.ref<!fir.char<1,{{[0-9]*}}>>) -> !fir.ref<i8>
! CHECK: %[[VAL_5:.*]] = arith.constant {{[0-9]*}} : i32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

! Check that we are accessing the clone inside the loop
!CHECK-DAG: omp.wsloop for (%[[INDX_WS:.*]]) : {{.*}} {
!CHECK-DAG: %[[NEG_ONE:.*]] = arith.constant -1 : i32
!CHECK-DAG: %[[UNIT:.*]] = arith.constant 6 : i32
!CHECK-NEXT: %[[ADDR:.*]] = fir.address_of(@_QQclX
!CHECK-NEXT: %[[CVT0:.*]] = fir.convert %[[ADDR]]
!CHECK-NEXT: %[[CNST:.*]] = arith.constant
!CHECK-NEXT: %[[CALL_BEGIN_IO:.*]] = fir.call @_FortranAioBeginExternalListOutput(%[[NEG_ONE]], %[[CVT0]], %[[CNST]]) {{.*}}: (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>
!CHECK-NEXT: %[[CALL_BEGIN_IO:.*]] = fir.call @_FortranAioBeginExternalListOutput(%[[UNIT]], %[[CVT0]], %[[CNST]]) {{.*}}: (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>
!CHECK-NEXT: %[[CVT_0_1:.*]] = fir.convert %[[ARG1_PVT]]
!CHECK-NEXT: %[[CVT_0_2:.*]] = fir.convert %[[FIVE]]
!CHECK-NEXT: %[[CALL_OP_ASCII:.*]] = fir.call @_FortranAioOutputAscii(%[[CALL_BEGIN_IO]], %[[CVT_0_1]], %[[CVT_0_2]])
Expand Down
Loading