This is an archive of the discontinued LLVM Phabricator instance.

[flang] Correct INQUIRE(POSITION= & PAD=)
ClosedPublic

Authored by klausler on Nov 29 2021, 3:38 PM.

Details

Summary

INQUIRE(POSITION=)'s results need to reflect the POSITION=
specifier used for the OPEN statement until the unit has been
repositioned. Preserve the POSITION= from OPEN and used it
for INQUIRE(POSITION=) until is becomes obsolete.

INQUIRE(PAD=) is implemented here in the case of an unconnected unit
with Fortran 2018 semantics; i.e., "UNDEFINED", rather than Fortran 90's
"YES"/"NO" (see 4.3.6 para 2). Apparent failures with F'90-only tests
will persist with INQUIRE(PAD=); these discrepancies don't seem to warrant
an option or environment variable.

To make the implementation of INQUIRE more closely match the language
in the standard, rename IsOpen() to IsConnected(), and use it explicitly
for the various INQUIRE specifiers.

Diff Detail

Event Timeline

klausler created this revision.Nov 29 2021, 3:38 PM
klausler requested review of this revision.Nov 29 2021, 3:38 PM
vdonaldson accepted this revision.Nov 29 2021, 4:46 PM
This revision is now accepted and ready to land.Nov 29 2021, 4:46 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptNov 30 2021, 1:52 PM