[flang] Fix actions at end of output record
authorpeter klausler <pklausler@nvidia.com>
Thu, 1 Oct 2020 17:59:09 +0000 (10:59 -0700)
committerpeter klausler <pklausler@nvidia.com>
Fri, 2 Oct 2020 00:18:20 +0000 (17:18 -0700)
commita94d943f1a3f42efede7e908bb250c84f9f442b1
tree8172f4e63a062646ac3e8bc95f34dace86c76b4f
parent78a9e62aa6f8f39fe8141e5486fca6db29947ecf
[flang] Fix actions at end of output record

It turns out that unformatted fixed-size output records
do need to be padded out if short, in order to avoid a
spurious EOF crash on a short record at the end of the file.
While here in AdvanceRecord(), move the unformatted
variable-length record header/footer writing code to here
from EndIoStatement().

Differential revision: https://reviews.llvm.org/D88685
flang/runtime/io-stmt.cpp
flang/runtime/io-stmt.h
flang/runtime/unit.cpp