2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / interface_30.f90
blobcfea7068ab2aa99f6f1add6b0109b5720918d23c
1 ! { dg-do compile }
3 ! PR39850: Too strict checking for procedures as actual argument
5 ! Original test case by Tobias Burnus <burnus@gcc.gnu.org>
6 ! Modified by Janus Weil <janus@gcc.gnu.org>
8 real function func()
9 print *,"func"
10 func = 42.0
11 end function func
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