3 ! Tests the fix for a bug that was found in the course of fixing PR87566.
5 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
10 type Object_array_pointer
11 class(*), pointer :: p(:) => null()
12 end type Object_array_pointer
14 type (Object_array_pointer
) :: obj
15 character(3), target
:: tgt1(2) = ['one','two']
16 character(5), target
:: tgt2(2) = ['three','four ']
17 real, target
:: tgt3(3) = [1.0,2.0,3.0]
20 associate (point
=> obj
%p
)
21 select
type (point
) ! Used to ICE here.
22 type is (character(*))
23 if (any (point
.ne
. tgt1
)) stop 1
28 select
type (z
=> obj
%p
)
29 type is (character(*))
30 if (any (z
.ne
. tgt2
)) stop 2
34 associate (point
=> obj
%p
)
37 if (any (point
.ne
. tgt3
)) stop 3
40 end subroutine AddArray