| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! PR fortran/40850 |
| 4 |
! The code freeing allocatable components used to be put after the code |
| 5 |
! freeing the containing entity. |
| 6 |
! |
| 7 |
! Original test case by Marco Restelli <[email protected]> |
| 8 |
! Reduced by Daniel Franke <[email protected]> |
| 9 |
! and Janus Weil <[email protected]> |
| 10 |
|
| 11 |
|
| 12 |
type t |
| 13 |
integer, allocatable :: d(:) |
| 14 |
end type |
| 15 |
type(t), allocatable :: a(:) |
| 16 |
|
| 17 |
! Big enough to make it fail |
| 18 |
allocate(a(2 * 1024)) |
| 19 |
call sub( (/ a /) ) |
| 20 |
|
| 21 |
contains |
| 22 |
|
| 23 |
subroutine sub(b) |
| 24 |
type(t) :: b(:) |
| 25 |
end subroutine |
| 26 |
|
| 27 |
end |
| 28 |
|