Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gfortran.dg/read_eof_1.f90 @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 ! { dg-do run { target fd_truncate } } | |
2 ! PR25697 Check that reading from a file that is at end-of-file does not | |
3 ! segfault or give error. Test case derived from example in PR from Dale Ranta. | |
4 ! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org> | |
5 integer data(9) | |
6 do i = 1,9 | |
7 data(i)=-3 | |
8 enddo | |
9 open(unit=11,status='scratch',form='unformatted') | |
10 write(11)data | |
11 read(11,end= 1000 )data | |
12 call abort() | |
13 1000 continue | |
14 backspace 11 | |
15 backspace 11 | |
16 write(11)data | |
17 rewind 11 | |
18 data = 0 | |
19 read(11,end= 1001 )data | |
20 1001 continue | |
21 read(11,end= 1002 )data | |
22 call abort | |
23 1002 continue | |
24 if (.not. all(data == -3)) call abort() | |
25 close(11) | |
26 end | |
27 |