view gcc/testsuite/gfortran.dg/namelist_44.f90 @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 84e7813d76e9
children
line wrap: on
line source

! { 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) STOP 1
!  write (*,nml=BLACKLIST)
end program gfcbug77