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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! PR 49296 List formatted read of file without EOR marker (\n).
3
program read_list_eof_1
4
  implicit none
5
  character(len=100) :: s
6
  integer :: ii
7
  real :: rr
8
  logical :: ll
9
 
10
  call genfil ('a')
11
  open (unit=20, file='read.dat', form='FORMATTED', action='READ', &
12
       status='OLD')
13
  read (20, fmt=*) s
14
  close (20, status='delete')
15
  if (trim(s) /= "a") then
16
     call abort ()
17
  end if
18
 
19
  call genfil ('1')
20
  open (unit=20, file='read.dat', form='FORMATTED', action='READ', &
21
       status='OLD')
22
  read (20, fmt=*) ii
23
  close (20, status='delete')
24
  if (ii /= 1) then
25
     call abort ()
26
  end if
27
 
28
  call genfil ('1.5')
29
  open (unit=20, file='read.dat', form='FORMATTED', action='READ', &
30
       status='OLD')
31
  read (20, fmt=*) rr
32
  close (20, status='delete')
33
  if (rr /= 1.5) then
34
     call abort ()
35
  end if
36
 
37
  call genfil ('T')
38
  open (unit=20, file='read.dat', form='FORMATTED', action='READ', &
39
       status='OLD')
40
  read (20, fmt=*) ll
41
  close (20, status='delete')
42
  if (.not. ll) then
43
     call abort ()
44
  end if
45
 
46
contains
47
  subroutine genfil(str)
48
    character(len=*), intent(in) :: str
49
    open(10, file='read.dat', form='unformatted', action='write', &
50
         status='replace', access='stream')
51
    write(10) str
52
    close(10)
53
  end subroutine genfil
54
end program read_list_eof_1

powered by: WebSVN 2.1.0

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