PR c++/27177
[official-gcc.git] / gcc / testsuite / gfortran.dg / advance_5.f90
blob3a48e5366063228a9cffb7ae3943ad50a8c6dd07
1 ! { dg-do run }
2 ! PR31207 Last record truncated for read after short write.
3 character(len=20) :: b
4 ! write something no advance
5 open(10,file="fort.10",position="rewind")
6 write(10, '(a,t1,a)',advance='no') 'xxxxxx', 'abc'
7 close(10)
8 ! append some data
9 open(10,file="fort.10",position="append")
10 write(10, '(a)') 'def'
11 close(10)
12 ! check what is in the first record
13 open(10,file="fort.10",position="rewind")
14 read(10,'(a)') b
15 close(10, status="delete")
16 if (b.ne."abcxxx") call abort()
17 end