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_2.f90] - Blame information for rev 827

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

Line No. Rev Author Line
1 149 jeremybenn
! { dg-do compile }
2
! Part II of the test  of the IO constraints patch, which fixes PRs:
3
! PRs 25053, 25063, 25064, 25066, 25067, 25068, 25069, 25307 and 20862.
4
! Modified2006-07-08 to check the patch for PR20844.
5
!
6
! Contributed by Paul Thomas  
7
!
8
 
9
module global
10
 
11
  integer :: modvar
12
  namelist /NL/ modvar
13
 
14
contains
15
 
16
  subroutine foo (i)
17
    integer :: i
18
    write (*, 100) i
19
 100 format (1h , "i=", i6)                     ! This is OK.
20
  end subroutine foo
21
 
22
end module global
23
 
24
 use global
25
 integer :: a,b, c(20)
26
 integer(8) :: ierr
27
 character*80 :: buffer(3)
28
 
29
 
30
! Appending to a USE associated namelist is an extension.
31
 
32
 NAMELIST /NL/ a,b                              ! { dg-warning "already is USE associated" }
33
 
34
 a=1 ; b=2
35
 
36
 write(*, NML=NL) z                             !  { dg-error "followed by IO-list" }
37
!Was correctly picked up before patch.
38
 print NL, z                                    !  { dg-error "followed by IO-list" }
39
!
40
! Not allowed with internal unit
41
!Was correctly picked up before patch.
42
 write(buffer, NML=NL)                          !  { dg-error "incompatible with namelist" }
43
!Was correctly picked up before patch.
44
 write(buffer, fmt='(i6)', REC=10) a            !  { dg-error "REC tag" }
45
 write(buffer, fmt='(i6)', END=10) a            !  { dg-error "END tag" }
46
 
47
! Not allowed with REC= specifier
48
!Was correctly picked up before patch.
49
 read(10, REC=10, END=100)                      !  { dg-error "END tag is not allowed" }
50
 write(*, *, REC=10)                            !  { dg-error "FMT=" }
51
 
52
! Not allowed with an ADVANCE=specifier
53
 READ(buffer, fmt='(i6)', advance='YES') a      ! { dg-error "internal file" }
54
 READ(1, NML=NL, advance='YES')                 ! { dg-error "NAMELIST IO is not allowed" }
55
 
56
 READ(1, advance='YES')                         ! { dg-error "must appear with an explicit format" }
57
 
58
 write(1, fmt='(i6)', advance='YES', size = c(1)) a ! { dg-error "output" }
59
 write(1, fmt='(i6)', advance='YES', eor = 100) a   ! { dg-error "output" }
60
 
61
 read(1, fmt='(i6)', advance='YES', size = c(1)) a  ! { dg-error "ADVANCE = 'NO'" }
62
 read(1, fmt='(i6)', advance='YES', eor = 100) a    ! { dg-error "ADVANCE = 'NO'" }
63
 
64
 READ(1, fmt='(i6)', advance='NO', size = buffer) a ! { dg-error "INTEGER" }
65
!Was correctly picked up before patch. -correct syntax error
66
 READ(1, fmt='(i6)', advance='YES', size = 10) a    ! { dg-error "Syntax error" }
67
 
68
 READ(1, fmt='(i6)', advance='MAYBE')               !  { dg-error "YES or NO" }
69
 
70
100 continue
71
200 format (2i6)
72
 END
73
 
74
! { dg-final { cleanup-modules "global" } }

powered by: WebSVN 2.1.0

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