Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gfortran.dg / namelist_18.f90
blobf5d4b3dd1e3808961def180d72c5ac31ff236a45
1 !{ dg-do run { target fd_truncate } }
2 ! Tests character delimiters for namelist write
3 ! provided by Paul Thomas - pault@gcc.gnu.org
5 program namelist_18
6 character*3 :: ch = "foo"
7 character*80 :: buffer
8 namelist /mynml/ ch
10 open (10, status = "scratch")
11 write (10, mynml)
12 rewind (10)
13 read (10, '(a)', iostat = ier) buffer
14 read (10, '(a)', iostat = ier) buffer
15 if (ier .ne. 0) call abort ()
16 close (10)
17 If ((buffer(5:5) /= "f") .or. (buffer(9:9) /= " ")) call abort ()
19 open (10, status = "scratch", delim ="quote")
20 write (10, mynml)
21 rewind (10)
22 read (10, '(a)', iostat = ier) buffer
23 read (10, '(a)', iostat = ier) buffer
24 if (ier .ne. 0) call abort ()
25 close (10)
26 If ((buffer(5:5) /= """") .or. (buffer(9:9) /= """")) call abort ()
28 open (10, status = "scratch", delim ="apostrophe")
29 write (10, mynml)
30 rewind (10)
31 read (10, '(a)', iostat = ier) buffer
32 read (10, '(a)', iostat = ier) buffer
33 if (ier .ne. 0) call abort ()
34 close (10)
35 If ((buffer(5:5) /= "'") .or. (buffer(9:9) /= "'")) call abort ()
37 end program namelist_18