2 ! { dg-options "-std=f2003 -fall-intrinsics" }
3 ! PR65596 Namelist reads too far.
4 integer ,parameter :: CL
=80
5 integer ,parameter :: AL
=4
8 character(CL
) :: cats(AL
)
9 character(CL
) :: dogs(AL
)
10 character(CL
) :: rslt(AL
)
13 namelist / theList
/ cats
, dogs
, mode
15 open(27,status
="scratch")
17 write(27,'(A)') "&theList"
18 write(27,'(A)') " mode = 'on'"
19 write(27,'(A)') " dogs = 'Rover',"
20 write(27,'(A)') " 'Spot'"
21 write(27,'(A)') " cats = 'Fluffy',"
22 write(27,'(A)') " 'Hairball'"
30 read (27, nml
=theList
, iostat
=ierr
)
32 if (ierr
.ne
. 0) call abort
34 rslt
= ['Rover ','Spot ','________','________']
35 if (any(dogs
.ne
.rslt
)) call abort
37 rslt
= ['Fluffy ','Hairball','________','________']
38 if (any(cats
.ne
.rslt
)) call abort