derived_comp_array_ref_1.f90

来自「用于进行gcc测试」· F90 代码 · 共 36 行

F90
36
字号
! { dg-do run }! Tests the fix for PR27411, in which the array reference on line! 18 caused an ICE because the derived type, rather than its integer! component, was appearing in the index expression.!! Contributed by Richard Maine  <1fhcwee02@sneakemail.com>!module gd_calc  type calc_signal_type    integer :: dummy    logical :: used    integer :: signal_number  end typecontains  subroutine activate_gd_calcs (used, outputs)    logical, intent(inout) :: used(:)    type(calc_signal_type), pointer :: outputs(:)      outputs%used = used(outputs%signal_number)    return  end subroutine activate_gd_calcsend module gd_calc  use gd_calc  integer, parameter :: ndim = 4  integer :: i  logical :: used_(ndim)  type(calc_signal_type), pointer :: outputs_(:)  allocate (outputs_(ndim))  forall (i = 1:ndim) outputs_(i)%signal_number = ndim + 1 - i  used_ = (/.true., .false., .true., .true./)  call activate_gd_calcs (used_, outputs_)  if (any (outputs_(ndim:1:-1)%used .neqv. used_)) call abort ()end! { dg-final { cleanup-modules "gd_calc" } }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?