2011-05-23 Tom de Vries <tom@codesourcery.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / namelist_16.f90
blobc6eb8f75595afcd39530f24f8073b1f1efec6c50
1 !{ dg-do run }
2 ! Tests namelist on complex variables
3 ! provided by Paul Thomas - pault@gcc.gnu.org
4 program namelist_16
5 complex(kind=8), dimension(2) :: z
6 namelist /mynml/ z
7 z = (/(1.0,2.0), (3.0,4.0)/)
9 open (10, status = "scratch")
10 write (10, '(A)') "&mynml z(1)=(5.,6.) z(2)=(7.,8.) /"
11 rewind (10)
13 read (10, mynml, iostat = ier)
14 if (ier .ne. 0) call abort ()
15 close (10)
17 open (10, status = "scratch")
18 write (10, mynml, iostat = ier)
19 if (ier .ne. 0) call abort ()
20 rewind (10)
22 z = (/(1.0,2.0), (3.0,4.0)/)
23 read (10, mynml, iostat = ier)
24 if (ier .ne. 0) call abort ()
25 close (10)
27 if ((z(1) .ne. (5.0,6.0)) .or. (z(2) .ne. (7.0,8.0))) call abort ()
29 end program namelist_16