view gcc/testsuite/gfortran.dg/subref_array_pointer_3.f90 @ 118:fd00160c1b76

ifdef TARGET_64BIT
author mir3636
date Tue, 27 Feb 2018 15:01:35 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { dg-do compile }
! Tests the fix for PR35470, in which the pointer assignment would fail
! because the assumed size 'arr' would get mixed up with the component
! 'p' in the check for the upper bound of an assumed size array.
!
! Contributed by Antony Lewis <antony@cosmologist.info>
!
subroutine sub(arr)
  type real_pointer
    real, pointer :: p(:)
  end type real_pointer
  type(real_pointer), dimension(*) :: arr
  real, pointer :: p(:)
  p => arr(1)%p
end subroutine