aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/pointer_init_8.f90
blob: aacd9a8e16e2dca9f5dfee0d31061f9c6e18f6e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
! { dg-do run }
!
! PR 57306: [OOP] ICE on valid with class pointer initialization
!
! Contributed by Andrew Benson <abensonca@gmail.com>

module m
  type :: c
  end type c
  type, extends(c) :: d
  end type d
  type(c), target :: x
  type(d), target :: y
end module m

 use m
  class(c), pointer :: px => x
  class(c), pointer :: py => y

  if (.not. associated(px, x))   call abort()
  if (.not. same_type_as(px, x)) call abort()
  if (.not. associated(py, y))   call abort()
  if (.not. same_type_as(py, y)) call abort()
end 

! { dg-final { cleanup-modules "m" } }