! { dg-do run }
|
! { dg-do run }
|
! Check "double" allocations of allocatable components (PR 20541).
|
! Check "double" allocations of allocatable components (PR 20541).
|
!
|
!
|
! Contributed by Erik Edelmann
|
! Contributed by Erik Edelmann
|
! and Paul Thomas
|
! and Paul Thomas
|
!
|
!
|
program main
|
program main
|
|
|
implicit none
|
implicit none
|
|
|
type foo
|
type foo
|
integer, dimension(:), allocatable :: array
|
integer, dimension(:), allocatable :: array
|
end type foo
|
end type foo
|
|
|
type(foo),allocatable,dimension(:) :: mol
|
type(foo),allocatable,dimension(:) :: mol
|
type(foo),pointer,dimension(:) :: molp
|
type(foo),pointer,dimension(:) :: molp
|
integer :: i
|
integer :: i
|
|
|
allocate (mol(1))
|
allocate (mol(1))
|
allocate (mol(1), stat=i)
|
allocate (mol(1), stat=i)
|
!print *, i ! /= 0
|
!print *, i ! /= 0
|
if (i == 0) call abort()
|
if (i == 0) call abort()
|
|
|
allocate (mol(1)%array(5))
|
allocate (mol(1)%array(5))
|
allocate (mol(1)%array(5),stat=i)
|
allocate (mol(1)%array(5),stat=i)
|
!print *, i ! /= 0
|
!print *, i ! /= 0
|
if (i == 0) call abort()
|
if (i == 0) call abort()
|
|
|
allocate (molp(1))
|
allocate (molp(1))
|
allocate (molp(1), stat=i)
|
allocate (molp(1), stat=i)
|
!print *, i ! == 0
|
!print *, i ! == 0
|
if (i /= 0) call abort()
|
if (i /= 0) call abort()
|
|
|
allocate (molp(1)%array(5))
|
allocate (molp(1)%array(5))
|
allocate (molp(1)%array(5),stat=i)
|
allocate (molp(1)%array(5),stat=i)
|
!print *, i ! /= 0
|
!print *, i ! /= 0
|
if (i == 0) call abort()
|
if (i == 0) call abort()
|
|
|
end program main
|
end program main
|
|
|