Imported Upstream version 4.7.3
[platform/upstream/gcc48.git] / gcc / testsuite / gfortran.dg / use_25.f90
1 ! { dg-do compile }
2 !
3 ! PR fortran/42769
4 ! This test used to be rejected because the typebound call A%GET was
5 ! simplified to MY_GET which is an ambiguous name in the main program
6 ! namespace.
7 !
8 ! Original testcase by Salvator Filippone <sfilippone@uniroma2.it>
9 ! Reduced by Janus Weil <janus@gcc.gnu.org>
10
11 module mod1
12   type :: t1
13   contains
14     procedure, nopass :: get => my_get
15   end type
16 contains 
17   subroutine my_get()
18     print *,"my_get (mod1)"
19   end subroutine
20 end module
21
22 module mod2
23 contains 
24   subroutine my_get()    ! must have the same name as the function in mod1
25     print *,"my_get (mod2)"
26   end subroutine
27 end module
28
29   use mod2
30   use mod1
31   type(t1) :: a
32   call call_get
33   contains
34   subroutine call_get
35     call a%get()
36   end subroutine call_get
37 end
38
39