Debian Codegraph @

gcc/testsuite/gfortran.dg/subref_array_pointer_3.f90

raw
1 ! { dg-do compile }
2 ! Tests the fix for PR35470, in which the pointer assignment would fail
3 ! because the assumed size 'arr' would get mixed up with the component
4 ! 'p' in the check for the upper bound of an assumed size array.
5 !
6 ! Contributed by Antony Lewis <[email protected]>
7 !
8 subroutine sub(arr)
9 type real_pointer
10 real, pointer :: p(:)
11 end type real_pointer
12 type(real_pointer), dimension(*) :: arr
13 real, pointer :: p(:)
14 p => arr(1)%p
15 end subroutine