alloc_comp_basics_2.f90
来自「用于进行gcc测试」· F90 代码 · 共 40 行
F90
40 行
! { dg-do run }
! Check "double" allocations of allocatable components (PR 20541).
!
! Contributed by Erik Edelmann <eedelmann@gcc.gnu.org>
! and Paul Thomas <pault@gcc.gnu.org>
!
program main
implicit none
type foo
integer, dimension(:), allocatable :: array
end type foo
type(foo),allocatable,dimension(:) :: mol
type(foo),pointer,dimension(:) :: molp
integer :: i
allocate (mol(1))
allocate (mol(1), stat=i)
!print *, i ! /= 0
if (i == 0) call abort()
allocate (mol(1)%array(5))
allocate (mol(1)%array(5),stat=i)
!print *, i ! /= 0
if (i == 0) call abort()
allocate (molp(1))
allocate (molp(1), stat=i)
!print *, i ! == 0
if (i /= 0) call abort()
allocate (molp(1)%array(5))
allocate (molp(1)%array(5),stat=i)
!print *, i ! /= 0
if (i == 0) call abort()
end program main
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?