Files
clang-p2996/flang/test/Semantics/io09.f90
Peter Klausler 4c6b60a639 [flang] Extension: allow char string edit descriptors in input formats (#140624)
FORMAT("J=",I3) is accepted by a few other Fortran compilers as a valid
format for input as well as for output. The character string edit
descriptor "J=" is interpreted as if it had been 2X on input, causing
two characters to be skipped over. The skipped characters don't have to
match the characters in the literal string. An optional warning is
emitted under control of the -pedantic option.
2025-05-28 13:58:22 -07:00

19 lines
503 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
!WARNING: String edit descriptor in READ format expression
read(*,'("abc")')
!ERROR: Unterminated string
!ERROR: Unterminated format expression
read(*,'("abc)')
!ERROR: 'H' edit descriptor in READ format expression
read(*,'(3Habc)')
!ERROR: 'H' edit descriptor in READ format expression
!ERROR: Unterminated format expression
read(*,'(5Habc)')
!ERROR: 'I' edit descriptor 'w' value must be positive
read(*,'(I0)')
end