2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / namelist_84.f90
blob14b68a44e8a340d1ebc39d38ee6e71b95684d640
1 ! { dg-do run }
2 program namelist_delim_none
3 implicit none
4 character(512) :: internal_unit
5 character(5), dimension(5) :: mystring
6 real, dimension(4) :: somenum
7 integer :: i
8 namelist /mylist/ mystring, somenum
9 mystring(1)='mon'
10 mystring(2)='tue'
11 mystring(3)='wed'
12 mystring(4)='thu'
13 mystring(5)='fri'
14 somenum = reshape(source = (/ 2, 3, 5, 7 /), shape=shape(somenum))
16 open(unit=10,status='scratch',delim='none')
17 write(10, mylist)
18 rewind(10)
19 mystring = "xxxxx"
20 rewind(10)
21 do i=1,5
22 read(10,'(a)') internal_unit
23 if (i.eq.2 .and. internal_unit .ne. " MYSTRING=mon tue wed thu fri ,") call abort
24 if (scan(internal_unit,"""'").ne.0) print *, internal_unit
25 end do
26 close(10)
27 end program