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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [io_constraints_7.f03] - Blame information for rev 739

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
 
3
! PR fortran/45776
4
! Variable definition context checks related to IO.
5
 
6
! Contributed by Daniel Kraft, d@domob.eu.
7
 
8
module m
9
  implicit none
10
  integer, protected :: a
11
  character(len=128), protected :: msg
12
end module m
13
 
14
program main
15
  use :: m
16
  integer :: x
17
  logical :: bool
18
 
19
  write (*, iostat=a) 42 ! { dg-error "variable definition context" }
20
  write (*, iomsg=msg) 42 ! { dg-error "variable definition context" }
21
  read (*, '(I2)', advance='no', size=a) x ! { dg-error "variable definition context" }
22
 
23
  ! These are ok.
24
  inquire (unit=a)
25
  inquire (file=msg, id=a, pending=bool)
26
  inquire (file=msg)
27
 
28
  ! These not, but list is not extensive.
29
  inquire (unit=1, number=a) ! { dg-error "variable definition context" }
30
  inquire (unit=1, encoding=msg) ! { dg-error "variable definition context" }
31
  inquire (unit=1, formatted=msg) ! { dg-error "variable definition context" }
32
 
33
  open (newunit=a, file="foo") ! { dg-error "variable definition context" }
34
  close (unit=a)
35
end program main
36
 
37
! { dg-final { cleanup-modules "m" } }

powered by: WebSVN 2.1.0

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