| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-fdump-tree-original" } |
| 3 |
module AModule |
| 4 |
implicit none |
| 5 |
private |
| 6 |
public Foo |
| 7 |
|
| 8 |
interface Foo |
| 9 |
module procedure FooPrivate |
| 10 |
end interface |
| 11 |
contains |
| 12 |
subroutine FooPrivate(x) |
| 13 |
integer :: x |
| 14 |
|
| 15 |
write(*,*) 'Foo(integer)' |
| 16 |
end subroutine |
| 17 |
end module |
| 18 |
module BModule |
| 19 |
implicit none |
| 20 |
private |
| 21 |
|
| 22 |
type, public :: BType |
| 23 |
contains |
| 24 |
procedure :: Foo |
| 25 |
end type |
| 26 |
contains |
| 27 |
subroutine Foo(self) |
| 28 |
class(BType) :: self |
| 29 |
|
| 30 |
write(*,*) 'Foo(BType)' |
| 31 |
end subroutine |
| 32 |
end module |
| 33 |
program iface_tbp_test |
| 34 |
use AModule |
| 35 |
implicit none |
| 36 |
|
| 37 |
call test() |
| 38 |
|
| 39 |
contains |
| 40 |
subroutine test() |
| 41 |
use BModule |
| 42 |
|
| 43 |
type(BType) :: y |
| 44 |
|
| 45 |
call y%Foo() |
| 46 |
call Foo(1) |
| 47 |
end subroutine |
| 48 |
end program |
| 49 |
! { dg-final { scan-tree-dump-times "foo \\(&class.2\\)" 1 "original" } } |