| 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") STOP 1 |
| 14 |
read(10) c |
| 15 |
if ((c.ne.achar(10)) .and. (c.ne.achar(13))) STOP 2 |
| 16 |
close (10, status="delete") |
| 17 |
10 format (a2,t1,a1,t2,a1,t20,' x') |
| 18 |
end |