gcc/testsuite/gfortran.dg/deferred_character_17.f90
raw| 1 | !{ dg-do run } |
| 2 | |
| 3 | ! Check fix for PR fortran/71623 |
| 4 | |
| 5 | program allocatemvce |
| 6 | implicit none |
| 7 | character(len=:), allocatable :: string |
| 8 | integer, dimension(4), target :: array = [1,2,3,4] |
| 9 | integer, dimension(:), pointer :: array_ptr |
| 10 | array_ptr => array |
| 11 | ! The allocate used to segfault |
| 12 | allocate(character(len=size(array_ptr))::string) |
| 13 | end program allocatemvce |