PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / gfortran.dg / nullify_3.f90
blob0d64f2b7926de38028cfe365baf575f97aa48205
1 ! { dg-do run }
2 ! { dg-options "-O0 -fbounds-check" }
3 ! Tests patch for PR29371, in which the null pointer
4 ! assignment would cause a segfault with the bounds
5 ! check on.
7 ! Contributed by Tobias Burnus <tobias.burnus@physik.fu-berlin.de>
9 program test
10 implicit none
11 type projector_t
12 real, pointer :: ket(:, :), bra(:, :)
13 end type projector_t
15 type(projector_t),pointer, dimension(:) :: p
16 integer :: stat,i
17 allocate(p(2),stat=stat)
18 do i = 1, 2
19 nullify(p(i)%bra)
20 nullify(p(i)%ket)
21 end do
22 do i = 1, 2
23 if (associated (p(i)%bra)) STOP 1
24 if (associated (p(i)%ket)) STOP 2
25 end do
26 end program