[flang-commits] [PATCH] D109505: [flang] Signal EOR in non advancing IO and move to next record

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Sep 9 06:29:19 PDT 2021


jeanPerier created this revision.
jeanPerier added a reviewer: klausler.
jeanPerier added a project: Flang.
Herald added a subscriber: jdoerfert.
jeanPerier requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When an end of record is met in non advancing IO:

- Set IOSTAT if present according to 12.11.4 (5).
- Position the file to the next record (12.11.4 (4)).

The previous code was only signaling EOR for fixed record length IO.
Reading at 12.11.4, I do not find the rational for this condition, so I
removed it.
It also does not seem the presence of padding should prevent
the EOR signaling.

The positionning to the next record was block when EOR is signaling
in FinishReadingRecord because ErrorHandler.isError() is true in this
case.
EOR in input is not an error, but I am not confident to modify
ErrorHandler.isError() to cover that. However, In FinishReadingRecord,
the code should not bail if the error is simply an end of record.

I did not check the SIZE requirements here because GetSize runtime is
not yet implemented.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109505

Files:
  flang/runtime/io-stmt.cpp
  flang/runtime/unit.cpp
  flang/unittests/Runtime/ExternalIOTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109505.371576.patch
Type: text/x-patch
Size: 5296 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20210909/bc79d2ed/attachment.bin>


More information about the flang-commits mailing list