PR c++/27177
[official-gcc.git] / gcc / testsuite / gfortran.dg / error_recovery_5.f90
blob88acf93ccf7a3e7c1ac9837db81e146d537d795a
1 ! { dg-do run }
2 ! PR34411 hang-up during read of non-expected input
3 ! Test case derived from that given in PR
4 ! Prior to patch, the do loop was infinite, limits set in this one
5 program pr34411
6 real :: x,y
7 ii = 0
8 iostat = 0
9 x = 0.0; y= 0.0
10 open (10, status="scratch")
11 write (10, '(a)')" 289 329.142 214.107 12.313 12.050 11.913 11.868"
12 write (10, '(a)')" 2038.497 99.99 0.00 0.019 0.021 0.025 0.034"
13 write (10, '(a)')""
14 write (10, '(a)')" 413 360.334 245.261 12.375 11.910 11.469 11.086"
15 write (10, '(a)')" 2596.395 99.99 0.00 0.019 0.017 0.016 0.015"
16 write (10, '(a)')""
17 write (10, '(a)')" 655 332.704 317.964 12.523 12.212 11.998 11.892"
18 write (10, '(a)')" 1627.586 99.99 0.00 0.005 0.005 0.006 0.007"
19 write (10, '(a)')""
20 write (10, '(a)')" 360 379.769 231.226 12.709 12.422 12.195 11.941"
21 write (10, '(a)')" 2561.539 99.99 0.00 0.042 0.043 0.050 0.055"
22 rewind 10
23 do i = 1,100
24 read(10,'(T7,2F9.3)', iostat=ii, end=666) x,y
25 end do
26 666 continue
27 if (i /= 12) call abort
28 if (x /= 379.76901 .and. y /= 231.22600) call abort
29 close(10)
30 end program pr34411