2017-11-10 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / allocate_assumed_charlen_1.f90
blob382df36375d55ada3e07898111763d1b999716bd
1 ! { dg-do run }
3 ! PR82934: Segfault on compilation in trans-stmt.c:5919(8.0.0).
4 ! The original report only had one item in the allocate list. This
5 ! has been doubled up to verify that the correct string length is
6 ! is used in the allocation.
8 ! Contributed by FortranFan on clf.
10 character(len=42), allocatable :: foo
11 character(len=22), allocatable :: foofoo
13 call alloc( foo , foofoo)
15 if (len(foo) .ne. 42) call abort
16 if (len(foofoo) .ne. 22) call abort
18 contains
20 subroutine alloc( bar, barbar )
22 character(len=*), allocatable :: bar, barbar
24 allocate( character(len=*) :: bar , barbar) ! <= Here!
26 end subroutine
28 end