[flang][runtime] Catch more (all?) negative unit number errors
authorPeter Klausler <pklausler@nvidia.com>
Sat, 11 Jun 2022 01:08:14 +0000 (18:08 -0700)
committerPeter Klausler <pklausler@nvidia.com>
Thu, 16 Jun 2022 00:29:50 +0000 (17:29 -0700)
commitcfbde7149d8647a4ff2eef892a30ffc55605df2c
treec61e0664cfeca69d20492c19c20fa78e4d4e7cbb
parent99796d06dbe11c8f81376ad1d42e7f17d2eff6ae
[flang][runtime] Catch more (all?) negative unit number errors

Fortran does have negative unit numbers -- they show up in child I/O
subroutines for defined I/O and for OPEN(NEWUNIT=) -- but the runtime
needs to catch the cases where a negative unit number that wasn't
generated by the runtime is passed in for OPEN or for an I/O statement
that would ordinarily create an anonymous "fort.NNN" file for a
hitherto unseen unit.

Differential Revision: https://reviews.llvm.org/D127788
flang/include/flang/Runtime/iostat.h
flang/runtime/io-api.cpp
flang/runtime/iostat.cpp
flang/runtime/unit-map.h
flang/runtime/unit.cpp
flang/runtime/unit.h