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

Subversion Repositories openrisc

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

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

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

powered by: WebSVN 2.1.0

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