124 lines · plain
1! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s2module m13 type base4 contains5 procedure, private :: binding => basesub6 generic :: generic => binding7 end type8 type, extends(base) :: ext19 contains10 procedure, private :: binding => ext1sub11 end type12 contains13 subroutine basesub(x)14 class(base), intent(in) :: x15 end16 subroutine ext1sub(x)17 class(ext1), intent(in) :: x18 end19 subroutine test120 type(ext1) x21!CHECK: CALL ext1sub(x)22 call x%generic23 end24end25 26module m227 use m128 type, extends(ext1) :: ext229 contains30 procedure :: binding => ext2sub31 end type32 contains33 subroutine ext2sub(x)34 class(ext2), intent(in) :: x35 end36 subroutine test237 type(ext2) x38!CHECK: CALL ext1sub(x)39 call x%generic ! private binding not overridable40 end41end42 43module m344 type base45 contains46 procedure, public :: binding => basesub47 generic :: generic => binding48 end type49 type, extends(base) :: ext150 contains51 procedure, public :: binding => ext1sub52 end type53 contains54 subroutine basesub(x)55 class(base), intent(in) :: x56 end57 subroutine ext1sub(x)58 class(ext1), intent(in) :: x59 end60 subroutine test161 type(ext1) x62!CHECK: CALL ext1sub(x)63 call x%generic64 end65end66 67module m468 use m369 type, extends(ext1) :: ext270 contains71 procedure :: binding => ext2sub72 end type73 contains74 subroutine ext2sub(x)75 class(ext2), intent(in) :: x76 end77 subroutine test278 type(ext2) x79!CHECK: CALL ext2sub(x)80 call x%generic ! public binding is overridable81 end82end83 84module m585 type base86 contains87 procedure, private :: binding => basesub88 generic :: generic => binding89 end type90 type, extends(base) :: ext191 contains92 procedure, public :: binding => ext1sub93 end type94 contains95 subroutine basesub(x)96 class(base), intent(in) :: x97 end98 subroutine ext1sub(x)99 class(ext1), intent(in) :: x100 end101 subroutine test1102 type(ext1) x103!CHECK: CALL ext1sub(x)104 call x%generic105 end106end107 108module m6109 use m5110 type, extends(ext1) :: ext2111 contains112 procedure :: binding => ext2sub113 end type114 contains115 subroutine ext2sub(x)116 class(ext2), intent(in) :: x117 end118 subroutine test2119 type(ext2) x120!CHECK: CALL ext2sub(x)121 call x%generic ! public binding is overridable122 end123end124