2005-12-23 Paolo Bonzini <bonzini@gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / namelist_empty.f90
blob12e72ae7e4da952483b450632102c2cf3e0cf17f
1 ! pr24584, segfault on namelist reading an empty string
2 ! Contributed by Jerry DeLisle <jvdelisle@verizon.net>
3 implicit none
4 character*20 temp
5 character(len=10) var
6 namelist /input/ var
7 var = 'Howdy'
8 open(unit=7, status="scratch")
9 temp = ' var=''''' ! var='' in the file
10 write(7,'(A6)') '&INPUT'
11 write(7,'(A10)') temp
12 write(7,'(A1)') '/'
13 rewind(7)
14 read(7,NML=input)
15 close(7)
16 if (var.ne.'') call abort
17 end