re PR fortran/78741 (ICE in gfc_get_symbol_decl, at fortran/trans-decl.c:1534)
[official-gcc.git] / gcc / testsuite / gfortran.dg / streamio_9.f90
blobb6bddb973f89bf5862695a63accecef8bcb59b21
1 ! { dg-do run }
2 ! PR29053 Stream IO test 9.
3 ! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>.
4 ! Test case derived from that given in PR by Steve Kargl.
5 program pr29053
6 implicit none
7 real dt, t, u, a(10), b(10)
8 integer i, place
9 dt = 1.e-6
10 a = real( (/ (i, i=1, 10) /) )
11 b = a
12 open(unit=11, file='a.dat', access='stream')
13 open(unit=12, file='b.dat', access='stream')
14 do i = 1, 10
15 t = i * dt
16 write(11) t
17 write(12) a
18 end do
19 rewind(11)
20 rewind(12)
21 do i = 1, 10
22 t = i * dt
23 read(12) a
24 if (any(a.ne.b)) STOP 1
25 read(11) u
26 if (u.ne.t) STOP 2
27 end do
28 close(11, status="delete")
29 close(12, status="delete")
30 end program pr29053