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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [io_constraints_1.f90] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
! { dg-do compile }
2
! Part I of the test  of the IO constraints patch, which fixes PRs:
3
! PRs 25053, 25063, 25064, 25066, 25067, 25068, 25069, 25307 and 20862.
4
!
5
! Contributed by Paul Thomas  
6
!
7
module fails
8
 
9
 2000 format (1h , 2i6)                        ! { dg-error "Format statement in module" }
10
 
11
end module fails
12
 
13
module global
14
 
15
  integer :: modvar
16
  namelist /NL/ modvar
17
 
18
contains
19
 
20
  subroutine foo (i)
21
    integer :: i
22
    write (*, 100) i
23
 100 format (1h , "i=", i6)                     ! This is OK.
24
  end subroutine foo
25
 
26
end module global
27
 
28
 use global
29
 integer :: a,b, c(20)
30
 integer(8) :: ierr
31
 character*80 :: buffer(3)
32
 
33
! Appending to a USE associated namelist is an extension.
34
 
35
 NAMELIST /NL/ a,b                              ! { dg-warning "already is USE associated" }
36
 
37
 a=1 ; b=2
38
 
39
!9.2.2.1:
40
 write(c, *) a, b                               !  { dg-error "array" }
41
!Was correctly picked up before patch.
42
 write(buffer((/3,1,2/)), *) a, b               !  { dg-error "vector subscript" }
43
 
44
!9.2.2.2 and one of 9.4.1
45
!________________________
46
 
47
 write(6, NML=NL, FMT = '(i6)')                 !  { dg-error "group name and format" }
48
 write(6, NML=NL, FMT = 200)                    !  { dg-error "group name and format" }
49
 
50
!9.4.1
51
!_____
52
!
53
 
54
! R912
55
!Was correctly picked up before patch.
56
 write(6, NML=NL, iostat = ierr)                ! { dg-warning "requires default INTEGER" }
57
 READ(1, fmt='(i6)', advance='NO', size = ierr) ! { dg-warning "requires default INTEGER" }
58
 
59
! Constraints
60
!Was correctly picked up before patch.
61
 write(1, fmt='(i6)', end = 100) a              ! { dg-error "END tag" }
62
!Was correctly picked up before patch.
63
 write(1, fmt='(i6)', eor = 100) a              ! { dg-error "EOR tag" }
64
!Was correctly picked up before patch.
65
 write(1, fmt='(i6)', size = b) a               ! { dg-error "SIZE=specifier not allowed" }
66
 
67
 
68
 READ(1, fmt='(i6)', end = 900) a               ! { dg-error "not defined" }
69
 READ(1, fmt='(i6)', eor = 900, advance='NO') a ! { dg-error "not defined" }
70
 READ(1, fmt='(i6)', ERR = 900) a               ! { dg-error "not defined" }
71
 
72
!Was correctly picked up before patch.
73
 READ(1, fmt=800) a                             ! { dg-error "not defined" }
74
 
75
 
76
100 continue
77
200 format (2i6)
78
 END
79
 
80
! { dg-final { cleanup-modules "fails global" } }

powered by: WebSVN 2.1.0

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