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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [interface_9.f90] - Diff between revs 149 and 154

Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
! { dg-do compile }
! { dg-do compile }
! Test of the patch for PR30096, in which gfortran incorrectly.
! Test of the patch for PR30096, in which gfortran incorrectly.
! compared local with host associated interfaces.
! compared local with host associated interfaces.
!
!
! Based on contribution by Harald Anlauf 
! Based on contribution by Harald Anlauf 
!
!
module module1
module module1
  interface inverse
  interface inverse
     module procedure A, B
     module procedure A, B
  end interface
  end interface
contains
contains
  function A (X) result (Y)
  function A (X) result (Y)
    real                        :: X, Y
    real                        :: X, Y
    Y = 1.0
    Y = 1.0
  end function A
  end function A
  function B (X) result (Y)
  function B (X) result (Y)
    integer                     :: X, Y
    integer                     :: X, Y
    Y = 3
    Y = 3
  end function B
  end function B
end module module1
end module module1
module module2
module module2
  interface inverse
  interface inverse
     module procedure C
     module procedure C
  end interface
  end interface
contains
contains
  function C (X) result (Y)
  function C (X) result (Y)
    real                        :: X, Y
    real                        :: X, Y
    Y = 2.0
    Y = 2.0
  end function C
  end function C
end module module2
end module module2
program gfcbug48
program gfcbug48
  use module1, only : inverse
  use module1, only : inverse
  call sub ()
  call sub ()
  if (inverse(1.0_4) /= 1.0_4) call abort ()
  if (inverse(1.0_4) /= 1.0_4) call abort ()
  if (inverse(1_4) /= 3_4) call abort ()
  if (inverse(1_4) /= 3_4) call abort ()
contains
contains
  subroutine sub ()
  subroutine sub ()
    use module2, only : inverse
    use module2, only : inverse
    if (inverse(1.0_4) /= 2.0_4) call abort ()
    if (inverse(1.0_4) /= 2.0_4) call abort ()
    if (inverse(1_4) /= 3_4) call abort ()
    if (inverse(1_4) /= 3_4) call abort ()
  end subroutine sub
  end subroutine sub
end program gfcbug48
end program gfcbug48
! { dg-final { cleanup-modules "module1 module2" } }
! { dg-final { cleanup-modules "module1 module2" } }
 
 

powered by: WebSVN 2.1.0

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