Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gfortran.dg / namelist_21.f90
blob8d2852d2cca1e95d3e0a9b2d5ca83748c5050f67
1 !{ dg-do run { target fd_truncate } }
2 ! Tests filling arrays from a namelist read when object list is not complete.
3 ! Developed from a test case provided by Christoph Jacob.
4 ! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>.
5 program pr24794
7 implicit none
8 integer, parameter :: maxop=15, iunit=7
9 character*8 namea(maxop), nameb(maxop)
10 integer i, ier
12 namelist/ccsopr/ namea,nameb
13 namea=""
14 nameb=""
15 open (12, status="scratch", delim="apostrophe")
16 write (12, '(a)') "&ccsopr"
17 write (12, '(a)') " namea='spi01h','spi02o','spi03h','spi04o','spi05h',"
18 write (12, '(a)') " 'spi07o','spi08h','spi09h',"
19 write (12, '(a)') " nameb='spi01h','spi03h','spi05h','spi06h','spi08h',"
20 write (12, '(a)') "&end"
22 rewind (12)
23 read (12, nml=ccsopr, iostat=ier)
24 if (ier.ne.0) call abort()
26 rewind (12)
27 write(12,nml=ccsopr)
29 rewind (12)
30 read (12, nml=ccsopr, iostat=ier)
31 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