3 ! Contributed by Andre Vehreschild
4 ! Check more elaborate class array addressing.
9 integer, allocatable :: a(:)
12 type, extends(InnerBaseT) :: InnerT
17 class(InnerT), allocatable :: arr(:,:)
24 subroutine indir(this, mat)
26 class(InnerT), intent(inout) :: mat(:,:)
31 subroutine P(this, mat)
33 class(InnerT), intent(inout) :: mat(:,:)
37 do i= 1, ubound(mat, 1)
38 do j= 1, ubound(mat, 2)
39 if (.not. allocated(mat(i,j)%a)) then
40 allocate(mat(i,j)%a(10), source = 72)
53 class(BaseT), allocatable, target :: o
54 class(InnerT), pointer :: i_p(:,:)
55 class(InnerBaseT), allocatable :: i_a(:,:)
60 allocate(InnerT::i_a(2,2))
65 if (any(o%arr%i /= reshape([9,42,42,42],[2,2]))) call abort()
69 if ((i == 1 .and. j == 1 .and. l == 5 .and. &
70 o%arr(i,j)%a(5) /= 1) &
71 .or. (.not. (i == 1 .and. j == 1 .and. l == 5) &
72 .and. o%arr(i,j)%a(l) /= 72)) call abort()
83 if ((i == 1 .and. j == 1 .and. l == 5 .and. &
85 .or. (.not. (i == 1 .and. j == 1 .and. l == 5) &
86 .and. i_a(i,j)%a(l) /= 72)) call abort()
94 if (any(o%arr%i /= reshape([9,42,42,42],[2,2]))) call abort()
97 ! vim:ts=2:sts=2:cindent:sw=2:tw=80: