This is an archive of the discontinued LLVM Phabricator instance.

[flang] Signal EOR in non advancing IO and move to next record
ClosedPublic

Authored by jeanPerier on Sep 9 2021, 6:29 AM.

Details

Summary

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.

Diff Detail

Event Timeline

jeanPerier created this revision.Sep 9 2021, 6:29 AM
jeanPerier requested review of this revision.Sep 9 2021, 6:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2021, 6:29 AM
klausler accepted this revision.Sep 9 2021, 9:40 AM
This revision is now accepted and ready to land.Sep 9 2021, 9:40 AM