2008-05-30 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / fmt_t_5.f90
blob0c27b6aa3eb3fa054a1319de11710567cd12ce37
1 ! { dg-do run { target fd_truncate } }
2 ! PR32678 GFortan works incorrectly when writing with FORMAT Tx
3 ! Before patch, NULLs were inserted in output.
4 ! Test case from reporter enhanced to detect this problem.
5 character(25) :: output
6 character(1) :: c
7 output = ""
8 open (unit=10, file="pr32678testfile", status="replace")
9 write (10,10) '12','a','b'
10 close (10, status="keep")
11 open (unit=10, file="pr32678testfile", access="stream")
12 read(10, pos=1) output(1:21)
13 if (output(1:21).ne."ab x") call abort
14 read(10) c
15 if ((c.ne.achar(10)) .and. (c.ne.achar(13))) call abort
16 close (10, status="delete")
17 10 format (a2,t1,a1,t2,a1,t20,' x')
18 end