OSDN Git Service

* obj-c++.dg/comp-types-10.mm: XFAIL for ICE.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / namelist_38.f90
1 ! { dg-do run { target fd_truncate } }
2 ! PR33253 namelist: reading back a string, also fixed writing with delimiters.
3 ! Test case modified from that of the PR by
4 ! Jerry DeLisle  <jvdelisle@gcc.gnu.org>
5 program main
6   implicit none
7   character(len=3) :: a
8   namelist /foo/ a
9
10   open(10, status="scratch", delim="quote")
11   a = 'a"a'
12   write(10,foo) 
13   rewind 10
14   a = ""
15   read (10,foo) ! This gave a runtime error before the patch.
16   if (a.ne.'a"a') call abort
17   close (10)
18
19   open(10, status="scratch", delim="apostrophe")
20   a = "a'a"
21   write(10,foo) 
22   rewind 10
23   a = ""
24   read (10,foo)
25   if (a.ne."a'a") call abort
26   close (10)
27
28   open(10, status="scratch", delim="none")
29   a = "a'a"
30   write(10,foo) 
31   rewind 10
32   a = ""
33   read (10,foo)
34   if (a.ne."a'a") call abort
35   close (10)
36 end program main