Debian Codegraph @

gcc/testsuite/gfortran.dg/interface_30.f90

raw
1 ! { dg-do compile }
2 !
3 ! PR39850: Too strict checking for procedures as actual argument
4 !
5 ! Original test case by Tobias Burnus <[email protected]>
6 ! Modified by Janus Weil <[email protected]>
7
8 real function func()
9 print *,"func"
10 func = 42.0
11 end function func
12
13 program test
14 external func1,func2,func3,func4 ! subroutine or implicitly typed real function
15 call sub1(func1)
16 call sub2(func2)
17 call sub1(func3)
18 call sub2(func3) ! { dg-error "is not a subroutine" }
19 call sub2(func4)
20 call sub1(func4) ! { dg-error "is not a function" }
21 contains
22 subroutine sub1(a1)
23 interface
24 real function a1()
25 end function
26 end interface
27 print *, a1()
28 end subroutine sub1
29 subroutine sub2(a2)
30 interface
31 subroutine a2
32 end subroutine
33 end interface
34 call a2()
35 end subroutine
36 end
37