OSDN Git Service

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