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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gfortran.dg/] [interface_25.f90] - Diff between revs 302 and 384

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

Rev 302 Rev 384
! { dg-do compile }
! { dg-do compile }
! Tests the fix for PR39295, in which the check of the interfaces
! Tests the fix for PR39295, in which the check of the interfaces
! at lines 25 and 42 failed because opfunc1 is identified as a
! at lines 25 and 42 failed because opfunc1 is identified as a
! function by usage, whereas opfunc2 is not.
! function by usage, whereas opfunc2 is not.
!
!
! Contributed by Jon Hurst 
! Contributed by Jon Hurst 
!
!
MODULE  funcs
MODULE  funcs
CONTAINS
CONTAINS
  INTEGER FUNCTION test1(a,b,opfunc1)
  INTEGER FUNCTION test1(a,b,opfunc1)
    INTEGER :: a,b
    INTEGER :: a,b
    INTEGER, EXTERNAL :: opfunc1
    INTEGER, EXTERNAL :: opfunc1
    test1 = opfunc1( a, b )
    test1 = opfunc1( a, b )
  END FUNCTION test1
  END FUNCTION test1
  INTEGER FUNCTION sumInts(a,b)
  INTEGER FUNCTION sumInts(a,b)
    INTEGER :: a,b
    INTEGER :: a,b
    sumInts = a + b
    sumInts = a + b
  END FUNCTION sumInts
  END FUNCTION sumInts
END MODULE funcs
END MODULE funcs
PROGRAM test
PROGRAM test
  USE funcs
  USE funcs
  INTEGER :: rs
  INTEGER :: rs
  INTEGER, PARAMETER :: a = 2, b = 1
  INTEGER, PARAMETER :: a = 2, b = 1
  rs = recSum( a, b, test1, sumInts )
  rs = recSum( a, b, test1, sumInts )
  write(*,*) "Results", rs
  write(*,*) "Results", rs
CONTAINS
CONTAINS
  RECURSIVE INTEGER FUNCTION recSum( a,b,UserFunction,UserOp ) RESULT( res )
  RECURSIVE INTEGER FUNCTION recSum( a,b,UserFunction,UserOp ) RESULT( res )
    IMPLICIT NONE
    IMPLICIT NONE
    INTEGER :: a,b
    INTEGER :: a,b
    INTERFACE
    INTERFACE
       INTEGER FUNCTION UserFunction(a,b,opfunc2)
       INTEGER FUNCTION UserFunction(a,b,opfunc2)
         INTEGER :: a,b
         INTEGER :: a,b
         INTEGER, EXTERNAL :: opfunc2
         INTEGER, EXTERNAL :: opfunc2
       END FUNCTION UserFunction
       END FUNCTION UserFunction
    END INTERFACE
    END INTERFACE
    INTEGER, EXTERNAL :: UserOp
    INTEGER, EXTERNAL :: UserOp
    res = UserFunction( a,b, UserOp )
    res = UserFunction( a,b, UserOp )
    if( res .lt. 10 ) then
    if( res .lt. 10 ) then
       res = recSum( a, res, UserFunction, UserOp )
       res = recSum( a, res, UserFunction, UserOp )
    end if
    end if
  END FUNCTION recSum
  END FUNCTION recSum
END PROGRAM test
END PROGRAM test
 
 

powered by: WebSVN 2.1.0

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