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

Subversion Repositories openrisc

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

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
 
11
  integer, protected :: a
12
  character(len=128), protected :: str
13
end module m
14
 
15
program main
16
  use :: m
17
  integer, parameter :: b = 42
18
  integer :: x
19
  character(len=128) :: myStr
20
 
21
  namelist /definable/ x, myStr
22
  namelist /undefinable/ x, a
23
 
24
  ! These are invalid.
25
  read (myStr, *) a ! { dg-error "variable definition context" }
26
  read (myStr, *) x, b ! { dg-error "variable definition context" }
27
  write (str, *) 5 ! { dg-error "variable definition context" }
28
  read (*, nml=undefinable) ! { dg-error "contains the symbol 'a' which may not" }
29
 
30
  ! These are ok.
31
  read (str, *) x
32
  write (myStr, *) a
33
  write (myStr, *) b
34
  print *, a, b
35
  write (*, nml=undefinable)
36
  read (*, nml=definable)
37
  write (*, nml=definable)
38
end program main
39
 
40
! { 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.