[flang][runtime] Improve Fortran I/O behavior when main program is C/C++
authorPeter Klausler <pklausler@nvidia.com>
Fri, 12 Aug 2022 00:16:10 +0000 (17:16 -0700)
committerPeter Klausler <pklausler@nvidia.com>
Thu, 18 Aug 2022 21:10:45 +0000 (14:10 -0700)
commit341c7c05df87394ac23842a0c27889b11a625058
tree86aa7cd5dfe1e5e4efaf0a6ea00e55518959fb96
parent0ac597f3cacf60479ffd36b03766fa7462dabd78
[flang][runtime] Improve Fortran I/O behavior when main program is C/C++

Ensure that I/O buffers are flushed at the end of the program,
and properly detect ttys for predefined units so that Fortran
output is interspersed with output from non-Fortran code.

Fixes https://github.com/llvm/llvm-project/issues/56944

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

Update: fix typo in comment
flang/runtime/file.cpp
flang/runtime/unit.cpp
flang/runtime/unit.h