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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
!
3
! PR 36947: Attributes not fully checked comparing actual vs dummy procedure
4
!
5
! Original test case by Walter Spector 
6
! Modified by Janus Weil 
7
 
8
module testsub
9
  contains
10
  subroutine test(sub)
11
    interface
12
      subroutine sub(x)
13
        integer, intent(in), optional:: x
14
      end subroutine
15
    end interface
16
    call sub()
17
  end subroutine
18
end module
19
 
20
module sub
21
  contains
22
  subroutine subActual(x)
23
    ! actual subroutine's argment is different in intent
24
    integer, intent(inout),optional:: x
25
  end subroutine
26
  subroutine subActual2(x)
27
    ! actual subroutine's argment is missing OPTIONAL
28
    integer, intent(in):: x
29
  end subroutine
30
end module
31
 
32
program interfaceCheck
33
  use testsub
34
  use sub
35
 
36
  integer :: a
37
 
38
  call test(subActual)  ! { dg-error "INTENT mismatch in argument" }
39
  call test(subActual2)  ! { dg-error "OPTIONAL mismatch in argument" }
40
end program
41
 
42
! { dg-final { cleanup-modules "sub testsub" } }
43
 

powered by: WebSVN 2.1.0

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