blob: 97d21aba65ff049e9cd7380e168a91dff015320f [file] [log] [blame]
! { dg-do run }
! { dg-options " -std=f2003" }
! Checks internal file read/write of namelists
! (Fortran 2003 feature)
! PR fortran/28224
program nml_internal
integer :: i, j
real :: r
namelist /nam/ i, j, r
character(len=250) :: str
i = 42
j = -718
r = exp(1.0)
write(str,nml=nam)
i = -33
j = 10
r = sin(1.0)
read(str,nml=nam)
if(i /= 42 .or. j /= -718 .or. abs(r-exp(1.0)) > 1e-5) STOP 1
end program nml_internal