[all-commits] [llvm/llvm-project] 05b4e4: [flang] Signal EOR in non advancing IO and move to...

jeanPerier via All-commits all-commits at lists.llvm.org
Fri Sep 10 04:09:20 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 05b4e49a17f5e997c0ccf4086dc0d2b8cec7e263
      https://github.com/llvm/llvm-project/commit/05b4e49a17f5e997c0ccf4086dc0d2b8cec7e263
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2021-09-10 (Fri, 10 Sep 2021)

  Changed paths:
    M flang/runtime/io-stmt.cpp
    M flang/runtime/unit.cpp
    M flang/unittests/Runtime/ExternalIOTest.cpp

  Log Message:
  -----------
  [flang] Signal EOR in non advancing IO and move to next record

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.

Differential Revision: https://reviews.llvm.org/D109505




More information about the All-commits mailing list