Debian Codegraph @

gcc/testsuite/gfortran.dg/pr113956.f90

raw
1 ! { dg-do run }
2 ! Test the fix for PR113956
3 ! Contributed by David Binderman <[email protected]>
4 module m
5 contains
6 subroutine test_array_char(p, x)
7 character(*), target :: x(:)
8 character(:), pointer :: p(:)
9 p => x ! ICE
10 end subroutine
11 end module
12
13 use m
14 character(:), allocatable, target :: chr(:)
15 character(:), pointer :: p(:)
16 chr = ["ab","cd"]
17 call test_array_char (p, chr)
18 if (loc (chr) .ne. loc (p)) stop 1
19 if (len (p) .ne. 2) stop 2
20 if (any (p .ne. chr)) stop 3
21 end