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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [read_eof_2.f90] - Blame information for rev 853

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
! { dg-do run }
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(2045) ! Exceed internal buffer size
6
       data=-1
7
       open(unit=11,status='scratch', form='unformatted')
8
       write(11)data
9
       read(11,end=        1000 )data
10
       call abort()
11
 1000  continue
12
       backspace 11
13
       backspace 11
14
       data = 0
15
       read(11)data
16
       if (.not. all(data == -1)) call abort()
17
       read(11,end=        1002 )data
18
       call abort()
19
 1002  continue
20
       close(11)
21
       end

powered by: WebSVN 2.1.0

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