aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/namelist_44.f90
blob: 143990261fe64f9f7e724308d18bce5997a7aa31 (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 }
!
! PR fortran/34530
!
! Skipping over comment line was not working
!
! Test case contributed by Harald Anlauf.
!
program gfcbug77
  implicit none

  character(len=128) :: file = ""
  logical            :: default
  namelist /BLACKLIST/ file, default
  integer, parameter :: nnml = 10
  default = .true.

  open (nnml, file='gfcbug77.nml')
  write(nnml,*) "&blacklist "           ! The trailing space breaks gfortran
  write(nnml,*) "  ! This is a comment within the namelist"
  write(nnml,*) "  file    = 'myfile'"
  write(nnml,*) "  default = F"
  write(nnml,*) "/"
  rewind(nnml)
  read (nnml, nml=BLACKLIST)
  close(nnml,status="delete")
  if(file /= "myfile" .or. default) call abort()
!  write (*,nml=BLACKLIST)
end program gfcbug77