2011-05-23 Tom de Vries <tom@codesourcery.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / dummy_procedure_2.f90
blobb58980863942b20217c543ec389f9624c8c9a5e8
1 ! { dg-do compile }
2 ! Checks the fix for the bug exposed in fixing PR25147
4 ! Contributed by Tobias Schlueter <tobi@gcc.gnu.org>
6 module integrator
7 interface
8 function integrate(f,xmin,xmax)
9 implicit none
10 interface
11 function f(x)
12 real(8) :: f,x
13 intent(in) :: x
14 end function f
15 end interface
16 real(8) :: xmin, xmax, integrate
17 end function integrate
18 end interface
19 end module integrator
21 use integrator
22 call foo1 ()
23 call foo2 ()
24 contains
25 subroutine foo1 ()
26 real(8) :: f ! This was not trapped: PR25147/25098
27 print *,integrate (f,0d0,3d0) ! { dg-error "Expected a procedure" }
28 end subroutine foo1
29 subroutine foo2 ()
30 real(8), external :: g ! This would give an error, incorrectly.
31 print *,integrate (g,0d0,3d0)
32 end subroutine foo2
33 end
34 ! { dg-final { cleanup-modules "integrator" } }