fix pr/45972
[official-gcc.git] / gcc / testsuite / gfortran.dg / list_read_7.f90
blob4ee08354b1d3a007a87e49c7728b1f43af28b384
1 ! { dg-do run }
2 ! PR33400 Formatted read fails if line ends without line break
3 ! Test case modified from that in PR by <jvdelisle@gcc.gnu.org>
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 call abort
14 if (trim(ieee_str2) /= &
15 '1.01010101010101010101011*2^-2') &
16 call abort
17 close(20, status="delete")
18 end