2 ! Tests the fix for PR39295, in which the check of the interfaces
3 ! at lines 25 and 42 failed because opfunc1 is identified as a
4 ! function by usage, whereas opfunc2 is not.
6 ! Contributed by Jon Hurst <jhurst@ucar.edu>
10 INTEGER FUNCTION test1(a,b,opfunc1)
12 INTEGER, EXTERNAL :: opfunc1
13 test1 = opfunc1( a, b )
15 INTEGER FUNCTION sumInts(a,b)
24 INTEGER, PARAMETER :: a = 2, b = 1
25 rs = recSum( a, b, test1, sumInts )
26 write(*,*) "Results", rs
28 RECURSIVE INTEGER FUNCTION recSum( a,b,UserFunction,UserOp ) RESULT( res )
32 INTEGER FUNCTION UserFunction(a,b,opfunc2)
34 INTEGER, EXTERNAL :: opfunc2
35 END FUNCTION UserFunction
37 INTEGER, EXTERNAL :: UserOp
39 res = UserFunction( a,b, UserOp )
41 if( res .lt. 10 ) then
42 res = recSum( a, res, UserFunction, UserOp )
47 ! { dg-final { cleanup-modules "funcs" } }