llvm-project/flang/runtime
Peter Klausler 06ca9f24e7 [flang] OPEN(RECL=) handling for sequential formatted I/O
RECL= is required for direct access I/O, but is permitted
as well for sequential I/O, where it is defined by the
standard to specify a maximum record (line) length.
The standard does not say what should happen when an
sequential formatted input record appears whose length is
unequal to RECL= when it is specified.

Precedents from other compilers are unclear: one raises an error,
some honor RECL= as an effective truncation, and a few ignore the
situation.  On output, all other compilers tested raised an
error when an attempt is made to emit a record longer than RECL=.

This patch treats RECL= as effective truncation on input and
as a hard limit with error on output, and also ensures that
RECL= can be set *longer* than the actual input record lengths.

Differential Revision: https://reviews.llvm.org/D115102
2021-12-04 16:02:48 -08:00
..
CMakeLists.txt [flang] Define & implement a lowering support API IsContiguous() in runtime 2021-11-30 14:15:56 -08:00
ISO_Fortran_binding.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
allocatable.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
assign.cpp [flang] Make subscript list argument a nullable pointer 2021-11-08 11:53:13 -08:00
buffer.cpp [flang] Remove *- C++ -* incantation from runtime .cpp files. NFC 2021-09-03 07:17:45 +00:00
buffer.h [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
character.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
command.cpp [flang] Implement GET_ENVIRONMENT_VARIABLE(VALUE) 2021-11-01 09:19:20 +00:00
complex-reduction.c [flang] Change complex type define in runtime for clang-cl 2021-09-22 06:54:33 +00:00
complex-reduction.h [flang] Change complex type define in runtime for clang-cl 2021-09-22 06:54:33 +00:00
config.h.cmake [flang] Support platforms without strerror_r 2020-03-28 16:46:43 -05:00
connection.cpp [flang] Complete the fix for NAMELIST look-ahead case 2021-11-08 10:01:16 -08:00
connection.h [flang] OPEN(RECL=) handling for sequential formatted I/O 2021-12-04 16:02:48 -08:00
copy.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
copy.h [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
derived-api.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
derived.cpp [flang][NFC] Document behavior for nonspecified/ambiguous cases 2021-10-11 11:06:07 -07:00
derived.h [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
descriptor-io.cpp [flang] Fix legitimate warning from latest GCC 2021-07-20 11:40:34 -07:00
descriptor-io.h [flang] Make subscript list argument a nullable pointer 2021-11-08 11:53:13 -08:00
descriptor.cpp [flang] Runtime performance improvements to real formatted input 2021-11-12 11:40:02 -08:00
dot-product.cpp [flang] Fix DOT_PRODUCT for logical 2021-10-22 15:56:20 -07:00
edit-input.cpp [flang] Remove typo that affected complex namelist input 2021-11-22 15:06:46 -08:00
edit-input.h [flang][msvc] Avoid dependence on long double 2020-10-07 15:12:08 -07:00
edit-output.cpp [flang] Fix rounding edge case in F output editing 2021-11-12 11:16:25 -08:00
edit-output.h [flang] Fix rounding edge case in F output editing 2021-11-12 11:16:25 -08:00
environment.cpp [flang] Respect NO_STOP_MESSAGE=1 in runtime 2021-11-12 10:50:36 -08:00
environment.h [flang] Respect NO_STOP_MESSAGE=1 in runtime 2021-11-12 10:50:36 -08:00
extrema.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
file.cpp [flang] Don't close stderr in runtime (fixes STOP output) 2021-12-01 13:25:18 -08:00
file.h [flang] Don't close stderr in runtime (fixes STOP output) 2021-12-01 13:25:18 -08:00
findloc.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
format-implementation.h [flang] Extension: allow tabs in output format strings 2021-10-22 15:53:29 -07:00
format.cpp [flang] Remove *- C++ -* incantation from runtime .cpp files. NFC 2021-09-03 07:17:45 +00:00
format.h [flang] Support NAMELIST input of short arrays 2021-10-22 13:38:11 -07:00
internal-unit.cpp [flang] OPEN(RECL=) handling for sequential formatted I/O 2021-12-04 16:02:48 -08:00
internal-unit.h [flang] Runtime performance improvements to real formatted input 2021-11-12 11:40:02 -08:00
io-api.cpp [flang] OPEN(RECL=) handling for sequential formatted I/O 2021-12-04 16:02:48 -08:00
io-error.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
io-error.h [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
io-stmt.cpp [flang] OPEN(RECL=) handling for sequential formatted I/O 2021-12-04 16:02:48 -08:00
io-stmt.h [flang] OPEN(RECL=) handling for sequential formatted I/O 2021-12-04 16:02:48 -08:00
iostat.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
lock.h [flang] More Fortran runtime support for CHARACTER operations 2020-06-17 15:51:48 -07:00
main.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
matmul.cpp [flang] Speed common runtime cases of DOT_PRODUCT & MATMUL 2021-10-22 14:36:13 -07:00
memory.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
misc-intrinsic.cpp [flang] Return arrays in Transfer runtime with SIZE argument 2021-12-03 08:23:30 +01:00
namelist.cpp [flang] Make subscript list argument a nullable pointer 2021-11-08 11:53:13 -08:00
namelist.h [flang] Support NAMELIST input of short arrays 2021-10-22 13:38:11 -07:00
numeric.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
pointer.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
product.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
random.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
reduction-templates.h [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
reduction.cpp [flang] Define & implement a lowering support API IsContiguous() in runtime 2021-11-30 14:15:56 -08:00
stat.cpp [flang] Implement GET_ENVIRONMENT_VARIABLE(VALUE) 2021-11-01 09:19:20 +00:00
stat.h [flang] Implement GET_ENVIRONMENT_VARIABLE(VALUE) 2021-11-01 09:19:20 +00:00
stop.cpp [flang] Skip `Fortran STOP:` before message when NO_STOP_MESSAGE is set 2021-11-18 18:08:06 +01:00
sum.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
support.cpp [flang] Define & implement a lowering support API IsContiguous() in runtime 2021-11-30 14:15:56 -08:00
terminator.cpp [flang] Remove *- C++ -* incantation from runtime .cpp files. NFC 2021-09-03 07:17:45 +00:00
terminator.h [flang] Define & implement a lowering support API IsContiguous() in runtime 2021-11-30 14:15:56 -08:00
time-intrinsic.cpp [flang] More work on SYSTEM_CLOCK runtime API and implementation 2021-10-12 09:24:24 -07:00
tools.cpp [flang] runtime: Read environment variables directly 2021-10-28 07:49:30 +00:00
tools.h [flang] Speed common runtime cases of DOT_PRODUCT & MATMUL 2021-10-22 14:36:13 -07:00
transformational.cpp [flang] Define & implement a lowering support API IsContiguous() in runtime 2021-11-30 14:15:56 -08:00
type-code.cpp [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
type-info.cpp [flang] Make subscript list argument a nullable pointer 2021-11-08 11:53:13 -08:00
type-info.h [flang] Make subscript list argument a nullable pointer 2021-11-08 11:53:13 -08:00
unit-map.cpp [flang] Remove *- C++ -* incantation from runtime .cpp files. NFC 2021-09-03 07:17:45 +00:00
unit-map.h [flang] Move runtime API headers to flang/include/flang/Runtime 2021-09-03 11:08:34 -07:00
unit.cpp [flang] OPEN(RECL=) handling for sequential formatted I/O 2021-12-04 16:02:48 -08:00
unit.h [flang] Correct INQUIRE(POSITION= & PAD=) 2021-11-30 13:51:48 -08:00