2008-07-06 Kai Tietz <kai.tietz@onevision.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / namelist_22.f90
blob3119e808640813891b700e055a8e36c6239a9d27
1 !{ dg-do run { target fd_truncate } }
2 ! Tests filling arrays from a namelist read when object list is not complete.
3 ! This is the same as namelist_21.f90 except using spaces as seperators instead
4 ! of commas. Developed from a test case provided by Christoph Jacob.
5 ! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>.
6 program pr24794
8 implicit none
9 integer, parameter :: maxop=15, iunit=7
10 character*8 namea(maxop), nameb(maxop)
11 integer i, ier
13 namelist/ccsopr/ namea,nameb
14 namea=""
15 nameb=""
16 open (12, status="scratch", delim="apostrophe")
17 write (12, '(a)') "&ccsopr"
18 write (12, '(a)') " namea='spi01h' 'spi02o' 'spi03h' 'spi04o' 'spi05h'"
19 write (12, '(a)') " 'spi07o' 'spi08h' 'spi09h'"
20 write (12, '(a)') " nameb='spi01h' 'spi03h' 'spi05h' 'spi06h' 'spi08h'"
21 write (12, '(a)') "&end"
23 rewind (12)
24 read (12, nml=ccsopr, iostat=ier)
25 if (ier.ne.0) call abort()
27 rewind (12)
28 write(12,nml=ccsopr)
30 rewind (12)
31 read (12, nml=ccsopr, iostat=ier)
32 if (ier.ne.0) call abort()
33 if (namea(2).ne."spi02o ") call abort()
34 if (namea(9).ne." ") call abort()
35 if (namea(15).ne." ") call abort()
36 if (nameb(1).ne."spi01h ") call abort()
37 if (nameb(6).ne." ") call abort()
38 if (nameb(15).ne." ") call abort()
40 close (12)
41 end program pr24794