2011-05-23 Tom de Vries <tom@codesourcery.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / namelist_internal.f90
blob4f8aeb2272d8308ef429bba53d09cea3bec92b40
1 ! { dg-do run }
2 ! { dg-options "-fall-intrinsics -std=f2003" }
3 ! Checks internal file read/write of namelists
4 ! (Fortran 2003 feature)
5 ! PR fortran/28224
6 program nml_internal
7 integer :: i, j
8 real :: r
9 namelist /nam/ i, j, r
10 character(len=250) :: str
12 i = 42
13 j = -718
14 r = exp(1.0)
15 write(str,nml=nam)
16 i = -33
17 j = 10
18 r = sin(1.0)
19 read(str,nml=nam)
20 if(i /= 42 .or. j /= -718 .or. abs(r-exp(1.0)) > 1e-5) call abort()
21 end program nml_internal