2013-08-06 Janus Weil <janus@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / pointer_init_8.f90
blobaacd9a8e16e2dca9f5dfee0d31061f9c6e18f6e0
1 ! { dg-do run }
3 ! PR 57306: [OOP] ICE on valid with class pointer initialization
5 ! Contributed by Andrew Benson <abensonca@gmail.com>
7 module m
8 type :: c
9 end type c
10 type, extends(c) :: d
11 end type d
12 type(c), target :: x
13 type(d), target :: y
14 end module m
16 use m
17 class(c), pointer :: px => x
18 class(c), pointer :: py => y
20 if (.not. associated(px, x)) call abort()
21 if (.not. same_type_as(px, x)) call abort()
22 if (.not. associated(py, y)) call abort()
23 if (.not. same_type_as(py, y)) call abort()
24 end
26 ! { dg-final { cleanup-modules "m" } }