summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/allocate_assumed_charlen_1.f90
blob: 382df36375d55ada3e07898111763d1b999716bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
! { dg-do run }
!
! PR82934: Segfault on compilation in trans-stmt.c:5919(8.0.0).
! The original report only had one item in the allocate list. This
! has been doubled up to verify that the correct string length is
! is used in the allocation.
!
! Contributed by FortranFan on clf.
!
   character(len=42), allocatable :: foo
   character(len=22), allocatable :: foofoo

   call alloc( foo , foofoo)

   if (len(foo) .ne. 42) call abort
   if (len(foofoo) .ne. 22) call abort

contains

   subroutine alloc( bar, barbar )

      character(len=*), allocatable :: bar, barbar

      allocate( character(len=*) :: bar , barbar) ! <= Here!

   end subroutine

end