Debian Codegraph @

gcc/testsuite/gfortran.dg/bounds_check_5.f90

raw
1 ! { dg-do run }
2 ! { dg-options "-fbounds-check" }
3 ! This tests the fix for PR30190, in which the array reference
4 ! in the associated statement would cause a segfault.
5 !
6 ! Contributed by Tobias Burnus <[email protected]>
7 !
8 TYPE particle_type
9 INTEGER, POINTER :: p(:)
10 END TYPE particle_type
11 TYPE(particle_type), POINTER :: t(:)
12 integer :: i
13 logical :: f
14 i = 1
15 allocate(t(1))
16 allocate(t(1)%p(0))
17 f = associated(t(i)%p,t(i)%p)
18 end