2015-07-03 Christophe Lyon <christophe.lyon@linaro.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / read_many_1.f
blob4fac689ac48b1296e34bafdfcbb3c0fc9ca30426
1 !{ dg-do run }
2 ! PR26423 Large file I/O error related to buffering
3 ! Test case derived from case by Dale Ranta.
4 ! Submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>
5 integer :: a(3000) , b(2048)
6 a=3
7 b=5
8 a(1) = 1
9 a(3000)=1234
10 write(2) a
11 b(1) = 2
12 b(2048) = 5678
13 write(2) b
14 rewind 2
15 read(2) a
16 read(2) b
17 if (a(1).ne.1) call abort()
18 if (a(2).ne.3) call abort()
19 if (b(1).ne.2) call abort()
20 if (b(2).ne.5) call abort()
21 if (a(3000).ne.1234) call abort()
22 if (b(2048).ne.5678) call abort()
23 close(2, status='delete')
24 end