| 1 |
! { dg-do run } |
| 2 |
! PR33400 Formatted read fails if line ends without line break |
| 3 |
! Test case modified from that in PR by <[email protected]> |
| 4 |
integer, parameter :: fgsl_strmax = 128 |
| 5 |
character(len=fgsl_strmax) :: ieee_str1, ieee_str2 |
| 6 |
open(unit=20, file='test.dat',form='FORMATTED', status="replace") |
| 7 |
write(20,'(a)',advance="no") ' 1.01010101010101010101010101010101& |
| 8 |
&01010101010101010101*2^-2 1.01010101010101010101011*2^-2' |
| 9 |
rewind(20) |
| 10 |
read(20, fmt=*) ieee_str1, ieee_str2 |
| 11 |
if (trim(ieee_str1) /= & |
| 12 |
'1.0101010101010101010101010101010101010101010101010101*2^-2') & |
| 13 |
STOP 1 |
| 14 |
if (trim(ieee_str2) /= & |
| 15 |
'1.01010101010101010101011*2^-2') & |
| 16 |
STOP 2 |
| 17 |
close(20, status="delete") |
| 18 |
end |