This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix INQUIRE(PAD=) and (POSITION=) for predefined units
ClosedPublic

Authored by klausler on Nov 16 2021, 1:47 PM.

Details

Summary

The predefined units were not being initialized with FORM='FORMATTED',
so INQUIRE(PAD=) was failing if no I/O had already been done.

INQUIRE(POSITION=) was returning 'REWIND' on stdin/stdout (which
is somewhat defensible from the definition, and is what Intel Fortran
does), but most implementations return 'ASIS'. Change the runtime
to return 'REWIND' only for positionable external files, but 'ASIS'
for terminals, sockets, &c.

Diff Detail

Event Timeline

klausler created this revision.Nov 16 2021, 1:47 PM
klausler requested review of this revision.Nov 16 2021, 1:47 PM
vdonaldson accepted this revision.Nov 17 2021, 10:23 AM
This revision is now accepted and ready to land.Nov 17 2021, 10:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2021, 4:27 PM