1! { dg-do run }
2! { dg-options "-fbackslash" }
3!
4! PR fortran/57633
5!
6program teststuff
7  implicit none
8  integer::a
9  character(len=10)::s1,s2
10
11  open(11,file="testcase.txt",form='unformatted',access='stream',status='new')
12  write(11) 'line1,1,\r\nline2'
13  close(11)
14
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
20
21  s1 = repeat('x', len(s1))
22  read(11,"(a)")s1
23  close(11,status="delete")
24  if (s1 /= "line2") STOP 2
25
26
27  open(11,file="testcase.txt",form='unformatted',access='stream',status='new')
28  write(11) 'word1\rword2,\n'
29  close(11)
30
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
38end program teststuff
39