Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gfortran.dg / list_read_5.f90
blobf69d1f3ccffa646f6c6a50ff79db46a4b13d5599
1 ! { dg-do run }
2 ! PR25307 Check handling of end-of-file conditions for list directed reads.
3 ! Prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
4 program pr25307
5 character(len=10) :: str
6 character(len=10) :: a(5)
7 a=""
8 a(1)="123"
9 a(3)="234"
10 str = '123'
11 ! Check internal unit
12 i = 0
13 j = 0
14 read( str, *, end=10 ) i,j
15 call abort()
16 10 continue
17 if (i.ne.123) call abort()
18 if (j.ne.0) call abort()
19 ! Check file unit
20 i = 0
21 write(10,'(a)') "123"
22 rewind(10)
23 read(10, *, end=20) i,j
24 call abort()
25 20 continue
26 if (i.ne.123) call abort()
27 if (j.ne.0) call abort()
28 ! Check internal array unit
29 i = 0
30 j = 0
31 k = 0
32 read(a(1:5:2),*, end=30)i,j,k
33 call abort()
34 30 continue
35 if (i.ne.123) call abort()
36 if (j.ne.234) call abort()
37 if (k.ne.0) call abort()
38 end program pr25307