aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/bounds_check_5.f90
blob: e2e32e3e53bc0250bf583e0e8b57a5926cbcf00a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
! { dg-do run }
! { dg-options "-fbounds-check" }
! This tests the fix for PR30190, in which the array reference
! in the associated statement would cause a segfault.
!
! Contributed by Tobias Burnus  <burnus@gcc.gnu.org>
!
  TYPE particle_type
     INTEGER, POINTER :: p(:)
  END TYPE particle_type
  TYPE(particle_type), POINTER  :: t(:)
  integer :: i
  logical :: f
  i = 1
  allocate(t(1))
  allocate(t(1)%p(0))
  f = associated(t(i)%p,t(i)%p)
end