3 ! Verifying the runtime behavior of the intrinsic function EXTENDS_TYPE_OF.
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
9 intrinsic :: extends_type_of
15 type, extends(t1) :: t2
19 type, extends(t2) :: t3
20 class(t1),pointer :: cc
23 class(t1), pointer :: c1,c2
32 if (.not. extends_type_of (c1, c1)) call abort()
33 if ( extends_type_of (c1, c2)) call abort()
34 if (.not. extends_type_of (c2, c1)) call abort()
36 if (.not. extends_type_of (x, x)) call abort()
37 if ( extends_type_of (x, y)) call abort()
38 if (.not. extends_type_of (y, x)) call abort()
40 if (.not. extends_type_of (c1, x)) call abort()
41 if ( extends_type_of (c1, y)) call abort()
42 if (.not. extends_type_of (x, c1)) call abort()
43 if (.not. extends_type_of (y, c1)) call abort()
45 if (.not. extends_type_of (z, c1)) call abort()
46 if ( extends_type_of (z%cc, z)) call abort()