| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-fdump-tree-original" } |
| 3 |
! |
| 4 |
! PR fortran/57456 |
| 5 |
! |
| 6 |
module m |
| 7 |
implicit none |
| 8 |
type t |
| 9 |
integer :: i |
| 10 |
end type t |
| 11 |
type, extends(t) :: t2 |
| 12 |
integer :: j |
| 13 |
end type t2 |
| 14 |
end module m |
| 15 |
|
| 16 |
program test |
| 17 |
use m |
| 18 |
implicit none |
| 19 |
integer :: i |
| 20 |
class(t), save, allocatable :: y(:) |
| 21 |
|
| 22 |
allocate (t2 :: y(5)) |
| 23 |
select type(y) |
| 24 |
type is (t2) |
| 25 |
do i = 1, 5 |
| 26 |
y(i)%i = i |
| 27 |
y(i)%j = i*10 |
| 28 |
end do |
| 29 |
end select |
| 30 |
deallocate(y) |
| 31 |
end |
| 32 |
|
| 33 |
! { dg-final { scan-tree-dump-times "__builtin_malloc \\(40\\);" 1 "original" } } |