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
11module mod1
12  type :: t1
13  contains
14    procedure, nopass :: get => my_get
15  end type
16contains
17  subroutine my_get()
18    print *,"my_get (mod1)"
19  end subroutine
20end module
21
22module mod2
23contains
24  subroutine my_get()    ! must have the same name as the function in mod1
25    print *,"my_get (mod2)"
26  end subroutine
27end 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
37end
38
39
40