[flang-commits] [PATCH] D123716: [flang][runtime] Preserve effect of positioning in record in non-advancing output

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Apr 14 15:37:05 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGa68612a964b4: [flang][runtime] Preserve effect of positioning in record in non-advancing… (authored by klausler).

Changed prior to commit:
  https://reviews.llvm.org/D123716?vs=422608&id=422975#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123716/new/

https://reviews.llvm.org/D123716

Files:
  flang/runtime/io-stmt.cpp


Index: flang/runtime/io-stmt.cpp
===================================================================
--- flang/runtime/io-stmt.cpp
+++ flang/runtime/io-stmt.cpp
@@ -318,8 +318,13 @@
     if (!mutableModes().nonAdvancing || GetIoStat() == IostatEor) {
       FinishReadingRecord();
     }
-  } else {
+  } else { // output
     if (mutableModes().nonAdvancing) {
+      // Make effects of positioning past the last Emit() visible with blanks.
+      std::int64_t n{unit().positionInRecord - unit().furthestPositionInRecord};
+      unit().positionInRecord = unit().furthestPositionInRecord;
+      while (n-- > 0 && unit().Emit(" ", 1, 1, *this)) {
+      }
       unit().leftTabLimit = unit().furthestPositionInRecord;
     } else {
       unit().leftTabLimit.reset();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123716.422975.patch
Type: text/x-patch
Size: 769 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220414/f4307759/attachment.bin>


More information about the flang-commits mailing list