PR target/83368
[official-gcc.git] / gcc / testsuite / gfortran.dg / fmt_with_extra.f
blob679728221857b4cf1a5db603e9841af1414b09df
1 ! { dg-do compile }
2 ! test case contributed by tobias.burnus@physik.fu-berlin.de
3 ! PR28039 Warn when ignoring extra characters in the format specification
4 implicit none
5 real :: r
6 r = 1.0
7 write(*,'(a),f)') 'Hello', r ! { dg-warning "Extraneous characters in format at" }
8 end
9 ! Below routine was also submitted by tobias.burnus@physik.fu-berlin.de
10 ! It showed up some problems with the initial implementation of this
11 ! feature.
12 ! This routine should compile without complaint or warning.
13 SUBROUTINE rw_inp()
14 CHARACTER(len=100) :: line
15 integer :: i5
16 character(100), parameter :: subchapter =
17 & '(79("-"),/,5("-")," ",A,/,79("-"),/)'
18 i5 = 1
20 READ(*,FMT="(4x,a)") line
21 7182 FORMAT (a3)
22 7130 FORMAT (i3)
24 WRITE (6,'(//'' icorr is not correctly transferred. icorr='',i5)
25 & ') 42
27 write(*,subchapter) 'test'
28 END SUBROUTINE rw_inp