nullify_3.f90
来自「用于进行gcc测试」· F90 代码 · 共 27 行
F90
27 行
! { dg-do run }! { dg-options "-O0 -fbounds-check" }! Tests patch for PR29371, in which the null pointer! assignment would cause a segfault with the bounds! check on.!! Contributed by Tobias Burnus <tobias.burnus@physik.fu-berlin.de>!program test implicit none type projector_t real, pointer :: ket(:, :), bra(:, :) end type projector_t type(projector_t),pointer, dimension(:) :: p integer :: stat,i allocate(p(2),stat=stat) do i = 1, 2 nullify(p(i)%bra) nullify(p(i)%ket) end do do i = 1, 2 if (associated (p(i)%bra)) call abort () if (associated (p(i)%ket)) call abort () end doend program
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?