1192811Srmacklem! { dg-do run }
2192811Srmacklem! PR34676 IO error delayed
3192811Srmacklem! Test case from PR modified by <jvdelisle@gcc.gnu.org>
4192811Srmacklemimplicit none
5192811Srmackleminteger::i,badness
6192811Srmacklemcharacter::c
7open(unit=10,status="scratch")
8write(10,'(a)') '1'
9write(10,'(a)') '2'
10write(10,'(a)') '3'
11rewind(10)
12do i=1,10
13  read(10,*,iostat=badness)
14  if (badness/=0) exit
15enddo
16if (i /= 4) call abort
17end
18