[flang-commits] [flang] 64aff36 - [flang][runtime] Fix ENDFILE for formatted stream output

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Fri Apr 15 18:57:36 PDT 2022


Author: Peter Klausler
Date: 2022-04-15T18:57:29-07:00
New Revision: 64aff3632f5b9a6d78e906342804766d49a1ec1d

URL: https://github.com/llvm/llvm-project/commit/64aff3632f5b9a6d78e906342804766d49a1ec1d
DIFF: https://github.com/llvm/llvm-project/commit/64aff3632f5b9a6d78e906342804766d49a1ec1d.diff

LOG: [flang][runtime] Fix ENDFILE for formatted stream output

A predicate expression made ENDFILE statements significant
only for sequential files, but it's applicable to formatted
stream output as well.

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

Added: 
    

Modified: 
    flang/runtime/unit.cpp

Removed: 
    


################################################################################
diff  --git a/flang/runtime/unit.cpp b/flang/runtime/unit.cpp
index e9eae5bd6918b..806e6b16d06b8 100644
--- a/flang/runtime/unit.cpp
+++ b/flang/runtime/unit.cpp
@@ -834,7 +834,7 @@ void ExternalFileUnit::DoImpliedEndfile(IoErrorHandler &handler) {
 }
 
 void ExternalFileUnit::DoEndfile(IoErrorHandler &handler) {
-  if (access == Access::Sequential) {
+  if (IsRecordFile()) {
     endfileRecordNumber = currentRecordNumber;
   }
   FlushOutput(handler);


        


More information about the flang-commits mailing list