| 1 |
! Test that parent components are made explicit in reference to |
| 2 |
! procedure pointer from parent type. |
| 3 |
! RUN: bbc -emit-hlfir -o - %s | FileCheck %s |
| 4 |
|
| 5 |
module type_defs |
| 6 |
interface |
| 7 |
subroutine s1 |
| 8 |
end subroutine |
| 9 |
real function s2() |
| 10 |
end function |
| 11 |
end interface |
| 12 |
type :: t |
| 13 |
procedure(s1), pointer, nopass :: p1 |
| 14 |
procedure(s2), pointer, nopass :: p2 |
| 15 |
end type |
| 16 |
type, extends(t) :: t2 |
| 17 |
end type |
| 18 |
end module |
| 19 |
|
| 20 |
! CHECK-LABEL: func.func @_QPtest( |
| 21 |
subroutine test (x) |
| 22 |
use type_defs, only : t2 |
| 23 |
type(t2) :: x |
| 24 |
call x%p1() |
| 25 |
! CHECK: %[[T_REF1:.*]] = hlfir.designate %{{.*}}{"t"} |
| 26 |
! CHECK: hlfir.designate %[[T_REF1]]{"p1"} |
| 27 |
print *, x%p2() |
| 28 |
! CHECK: %[[T_REF2:.*]] = hlfir.designate %{{.*}}{"t"} |
| 29 |
! CHECK: hlfir.designate %[[T_REF2]]{"p2"} |
| 30 |
end subroutine |