Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / module_interface_2.f90
blob1f9fde81edb4e4afc7753e72f8d5f68afdcc9418
1 ! { dg-do compile }
2 ! Tests the fix for PR29464, in which the second USE of the generic
3 ! interface caused an error.
5 ! Contributed by Vivek Rao <vivekrao4@yahoo.com>
7 module foo_mod
8 implicit none
9 interface twice
10 module procedure twice_real
11 end interface twice
12 contains
13 real function twice_real(x)
14 real :: x
15 twice_real = 2*x
16 end function twice_real
17 end module foo_mod
19 subroutine foobar ()
20 use foo_mod, only: twice, twice
21 print *, twice (99.0)
22 end subroutine foobar
24 program xfoo
25 use foo_mod, only: two => twice, dbl => twice
26 implicit none
27 call foobar ()
28 print *, two (2.3)
29 print *, dbl (2.3)
30 end program xfoo
31 ! { dg-final { cleanup-modules "foo_mod" } }