Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / interface_8.f90
blob7feccb38b40765b30db7f4e20d08c16cd437f22d
1 ! { dg-do compile }
2 ! One of the tests of the patch for PR30068.
3 ! Taken from comp.lang.fortran 3rd December 2006.
5 ! Although the generic procedure is not referenced and it would
6 ! normally be permissible for it to be ambiguous, the USE, ONLY
7 ! statement is effectively a reference and is invalid.
9 module mod1
10 interface generic
11 subroutine foo(a)
12 real :: a
13 end subroutine
14 end interface generic
15 end module mod1
17 module mod2
18 interface generic
19 subroutine bar(a)
20 real :: a
21 end subroutine
22 end interface generic
23 end module mod2
25 program main
26 use mod1, only: generic ! { dg-warning "has ambiguous interfaces" }
27 use mod2
28 end program main
30 ! { dg-final { cleanup-modules "mod1 mod2" } }