Plugins: Add label-text.h to CPPLIB_H so it will be installed [PR115288]
[official-gcc.git] / gcc / testsuite / gfortran.dg / list_read_11.f90
blob8e5fdd1ed232890c68285b64be26ea11d39e6a8d
1 ! { dg-do run }
2 ! { dg-options "-fbackslash" }
4 ! PR fortran/57633
6 program teststuff
7 implicit none
8 integer::a
9 character(len=10)::s1,s2
11 open(11,file="testcase.txt",form='unformatted',access='stream',status='new')
12 write(11) 'line1,1,\r\nline2'
13 close(11)
15 open(11,file="testcase.txt",form='formatted')
16 s1 = repeat('x', len(s1))
17 a = 99
18 read(11,*)s1,a
19 if (s1 /= "line1" .or. a /= 1) STOP 1
21 s1 = repeat('x', len(s1))
22 read(11,"(a)")s1
23 close(11,status="delete")
24 if (s1 /= "line2") STOP 2
27 open(11,file="testcase.txt",form='unformatted',access='stream',status='new')
28 write(11) 'word1\rword2,\n'
29 close(11)
31 open(11,file="testcase.txt",form='formatted')
32 s1 = repeat('x', len(s1))
33 s2 = repeat('x', len(s1))
34 read(11,*)s1,s2
35 close(11,status="delete")
36 if (s1 /= "word1") STOP 3
37 if (s2 /= "word2") STOP 4
38 end program teststuff