3 ! Contributed by Antony Lewis <antony@cosmologist.info>
4 ! Andre Vehreschild <vehre@gcc.gnu.org>
5 ! Check that associating array-sections/scalars is working
14 class(T), allocatable :: av(:)
15 class(T), allocatable :: am(:,:)
16 class(T), pointer :: pv(:)
17 class(T), pointer :: pm(:,:)
20 integer :: im(4,5) = 23
21 integer :: expect(20) = 23
28 if (any (av%map /= [2,1])) call abort()
32 associate(pam => am(2:3, 2:3))
36 if (any (reshape(am%map, [12]) /= [1,1,1, 1,7,7, 1,8,7, 1,1,1])) call abort()
43 if (any (pv%map /= [2,1])) call abort()
47 associate(ppm => pm(2:3, 2:3))
51 if (any (reshape(pm%map, [12]) /= [1,1,1, 1,7,7, 1,8,7, 1,1,1])) call abort()
57 if (any (iv /= [7, 17, 17, 17, 17])) call abort()
59 associate(pam => im(2:3, 2:3))
66 if (any (reshape(im, [20]) /= [23,23,23,23, 23,9,0,23, &
67 23,10,0,23, 23,23,23,23, 23,23,23,23])) call abort()
72 associate(pam => im(:, c))
75 if (any (reshape(im, [20]) /= expect)) call abort()
77 expect = [expect(17:), expect(:16)]