Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / fmt_t_5.f90
blobe3c69319bd1e0a0b0f221e19b734d1bce83b1b82
1 ! { dg-do run }
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