OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [read_eof_3.f90] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run { target fd_truncate } }
2
! PR25835 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  
5
       integer data(5000)
6
       data=-256
7
       open(unit=11,status='scratch', form='unformatted')
8
       write(11)data
9
       write(11)data
10
       read(11,end=        1000 )data
11
       call abort()
12
 1000  continue
13
       backspace 11
14
       rewind 11
15
       write(11)data
16
       read(11,end=        1001 )data
17
       call abort()
18
 1001  continue
19
       data = 0
20
       backspace 11
21
       rewind 11
22
       read(11,end=        1002 )data
23
       if (.not. all(data == -256)) call abort()
24
 1002  continue
25
       read(11,end=        1003 )data
26
       call abort()
27
 1003  continue
28
       close(11)
29
       end
30
 
31
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.