coarray_41.f90: Add "-latomic" option if libatomic_available.
[official-gcc.git] / gcc / testsuite / gfortran.dg / namelist_empty.f90
blob89493a84b343b2103ba24fa53d6abbe54e085e92
1 ! { dg-do compile }
2 ! { dg-options "-std=legacy" }
4 ! pr24584, segfault on namelist reading an empty string
5 ! Contributed by Jerry DeLisle <jvdelisle@verizon.net>
6 implicit none
7 character*20 temp
8 character(len=10) var
9 namelist /input/ var
10 var = 'Howdy'
11 open(unit=7, status="scratch")
12 temp = ' var=''''' ! var='' in the file
13 write(7,'(A6)') '&INPUT'
14 write(7,'(A10)') temp
15 write(7,'(A1)') '/'
16 rewind(7)
17 read(7,NML=input)
18 close(7)
19 if (var.ne.'') call abort
20 end