2 ! Tests the fix for PR39295, in which the check of the interfaces
3 ! at lines 26 and 43 failed because opfunc1 is identified as a
4 ! function by usage, whereas opfunc2 is not. This testcase checks
5 ! that TKR is stll OK in these cases.
7 ! Contributed by Jon Hurst <jhurst@ucar.edu>
11 INTEGER FUNCTION test1(a
,b
,opfunc1
)
13 INTEGER, EXTERNAL :: opfunc1
14 test1
= opfunc1( a
, b
)
16 INTEGER FUNCTION sumInts(a
,b
)
25 INTEGER, PARAMETER :: a
= 2, b
= 1
26 rs
= recSum( a
, b
, test1
, sumInts
) ! { dg-error "Type/rank mismatch in argument" }
27 write(*,*) "Results", rs
29 RECURSIVE INTEGER FUNCTION recSum( a
,b
,UserFunction
,UserOp
) RESULT( res
)
33 INTEGER FUNCTION UserFunction(a
,b
,opfunc2
)
35 REAL, EXTERNAL :: opfunc2
36 END FUNCTION UserFunction
38 INTEGER, EXTERNAL :: UserOp
40 res
= UserFunction( a
,b
, UserOp
) ! { dg-error "Type/kind mismatch in return value" }
42 if( res
.lt
. 10 ) then
43 res
= recSum( a
, res
, UserFunction
, UserOp
)