summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/namelist_16.f90
blob: c6eb8f75595afcd39530f24f8073b1f1efec6c50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
!{ dg-do run }
! Tests namelist on complex variables
! provided by Paul Thomas - pault@gcc.gnu.org
program namelist_16
  complex(kind=8), dimension(2)  ::   z
  namelist /mynml/ z
  z = (/(1.0,2.0), (3.0,4.0)/)

  open (10, status = "scratch")
  write (10, '(A)') "&mynml z(1)=(5.,6.) z(2)=(7.,8.) /"
  rewind (10)

  read (10, mynml, iostat = ier)
  if (ier .ne. 0) call abort ()
  close (10)

  open (10, status = "scratch")
  write (10, mynml, iostat = ier)
  if (ier .ne. 0) call abort ()
  rewind (10)

  z = (/(1.0,2.0), (3.0,4.0)/)
  read (10, mynml, iostat = ier)
  if (ier .ne. 0) call abort ()
  close (10)

  if ((z(1) .ne. (5.0,6.0)) .or. (z(2) .ne. (7.0,8.0))) call abort ()

end program namelist_16