3 ! Make sure that the fix for pr34640 works with class pointers.
16 type(thytype
), dimension(0:2), target
:: tgt
17 class(*), dimension(:), pointer :: cptr
18 class(mytype
), dimension(:), pointer :: cptr1
22 tgt
= [(thytype(int(i
), i
, mytype(int(2*i
), 2*i
)), i
= 1,3)]
25 if (lbound (cptr
, 1) .ne
. 1) Call abort
! Not a whole array target!
28 call foo (cptr
, s2
) ! Check bounds not changed...
29 if (s1
.ne
. s2
) Call abort
! ...and that the descriptor is passed.
33 if (any (cptr
.ne
. [1,2,3])) call abort
! Check the the scalarizer works.
34 if (cptr(2) .ne
. 2) call abort
! Check ordinary array indexing.
37 cptr(1:3) => tgt
%der
%r
! Something a tad more complicated!
41 if (any (int(cptr
) .ne
. [2,4,6])) call abort
42 if (any (int(cptr([2,3,1])) .ne
. [4,6,2])) call abort
43 if (int(cptr(3)) .ne
. 6) call abort
50 if (s1
.ne
. s2
) Call abort
! Check that the descriptor is passed.
54 if (any (cptr1
%i
.ne
. [2,4,6])) call abort
55 if (cptr1(2)%i
.ne
. 4) call abort
60 subroutine foo (arg
, addr
)
61 class(*), dimension(:), pointer :: arg
66 if (any (arg
.ne
. [1,2,3])) call abort
! Check the the scalarizer works.
67 if (arg(2) .ne
. 2) call abort
! Check ordinary array indexing.
71 subroutine bar (arg
, addr
)
72 class(mytype
), dimension(:), pointer :: arg
77 if (any (arg
%i
.ne
. [2,4,6])) call abort
78 if (arg(2)%i
.ne
. 4) call abort