53 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic2 3module m4 type, bind(c) :: explicit_bind_c5 real a6 end type7 type :: interoperable18 type(explicit_bind_c) a9 end type10 type, extends(interoperable1) :: interoperable211 real b12 end type13 type :: non_interoperable114 real, allocatable :: a15 end type16 type :: non_interoperable217 type(non_interoperable1) b18 end type19 type :: no_bind_c20 real a21 end type22 type, bind(c) :: has_bind_c23 !WARNING: Derived type of component 'a' of an interoperable derived type should have the BIND attribute24 type(no_bind_c) :: a25 end type26 interface27 subroutine sub_bind_c_1(x_bind_c) bind(c)28 import explicit_bind_c29 type(explicit_bind_c), intent(in) :: x_bind_c30 end31 subroutine sub_bind_c_2(x_interop1) bind(c)32 import interoperable133 !WARNING: The derived type of an interoperable object should be BIND(C)34 type(interoperable1), intent(in) :: x_interop135 end36 subroutine sub_bind_c_3(x_interop2) bind(c)37 import interoperable238 !WARNING: The derived type of an interoperable object should be BIND(C)39 type(interoperable2), intent(in) :: x_interop240 end41 subroutine sub_bind_c_4(x_non_interop1) bind(c)42 import non_interoperable143 !ERROR: The derived type of an interoperable object must be interoperable, but is not44 type(non_interoperable1), intent(in) :: x_non_interop145 end46 subroutine sub_bind_c_5(x_non_interop2) bind(c)47 import non_interoperable248 !ERROR: The derived type of an interoperable object must be interoperable, but is not49 type(non_interoperable2), intent(in) :: x_non_interop250 end51 end interface52end53