OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [rewind_1.f90] - Blame information for rev 405

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

Line No. Rev Author Line
1 149 jeremybenn
! { dg-do run }
2
! Check that rewind doesn't delete a file.
3
! Writing to the file truncates it at the end of the current record.  Out
4
! IO library was defering the actual truncation until the file was rewound.
5
! A second rewind would then (incorrectly) think the file had just been
6
! written to, and truncate the file to zero length.
7
program foo
8
  character*11 s
9
  open(unit=11, status="SCRATCH")
10
  write(11, '(a11)') "Hello World"
11
  rewind(11)
12
  rewind(11)
13
  s = ""
14
  read(11, '(a11)') s
15
  close(11)
16
  if (s .ne. "Hello World") call abort
17
end program
18
 

powered by: WebSVN 2.1.0

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