2009-10-05 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / backslash_3.f
blob8625b3724e429e2944462cb2ed7b9006f1c8c6d6
1 C { dg-do run { target fd_truncate } }
2 C { dg-options "-fbackslash" }
3 C PR fortran/30278
4 program a
5 character(len=1), parameter :: c1 = char(8), c2 = char(92)
6 character(len=35) str1, str2
7 character(len=37) :: str4, str3
9 open(10, status='scratch')
10 write(10, 100)
11 rewind(10)
12 read(10,'(A34)') str1
13 str2 = 'Does ' // c1 // 'ackslash result in ' // c1 // 'ackslash'
14 if (str1 .ne. str2) call abort
16 rewind(10)
17 write (10, 200)
18 rewind(10)
19 read(10,'(A37)') str3
20 str4 = 'Does ' //c2// 'backslash result in ' //c2// 'backslash'
21 if (str3 .ne. str4) call abort
23 stop
24 100 format ('Does \backslash result in \backslash')
25 200 format ('Does \\backslash result in \\backslash')
26 end