[all-commits] [llvm/llvm-project] 80cdf0: [flang] Correct INQUIRE(POSITION= & PAD=)

Peter Klausler via All-commits all-commits at lists.llvm.org
Tue Nov 30 13:52:03 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 80cdf0db67e2c0f231f4fefc2b873690b44f84cc
      https://github.com/llvm/llvm-project/commit/80cdf0db67e2c0f231f4fefc2b873690b44f84cc
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2021-11-30 (Tue, 30 Nov 2021)

  Changed paths:
    M flang/runtime/connection.h
    M flang/runtime/file.cpp
    M flang/runtime/file.h
    M flang/runtime/io-stmt.cpp
    M flang/runtime/unit.cpp
    M flang/runtime/unit.h

  Log Message:
  -----------
  [flang] Correct INQUIRE(POSITION= & PAD=)

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.

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




More information about the All-commits mailing list