| 1 |
! { dg-do run } |
| 2 |
! |
| 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. |
| 7 |
! |
| 8 |
! Contributed by FortranFan on clf. |
| 9 |
! |
| 10 |
character(len=42), allocatable :: foo |
| 11 |
character(len=22), allocatable :: foofoo |
| 12 |
|
| 13 |
call alloc( foo , foofoo) |
| 14 |
|
| 15 |
if (len(foo) .ne. 42) STOP 1 |
| 16 |
if (len(foofoo) .ne. 22) STOP 2 |
| 17 |
|
| 18 |
contains |
| 19 |
|
| 20 |
subroutine alloc( bar, barbar ) |
| 21 |
|
| 22 |
character(len=*), allocatable :: bar, barbar |
| 23 |
|
| 24 |
allocate( character(len=*) :: bar , barbar) ! <= Here! |
| 25 |
|
| 26 |
end subroutine |
| 27 |
|
| 28 |
end |