2 ! Test the fix for PR38852 and PR39006 in which LBOUND did not work
3 ! for some arrays with negative strides.
5 ! Contributed by Dick Hendrickson <dick.hendrickson@gmail.com>
6 ! Clive Page <clivegpage@googlemail.com>
7 ! and Mikael Morin <mikael.morin@tele2.fr>
12 integer, parameter :: nx
= 4, ny
= 3
14 SUBROUTINE PR38852(IDA
,DDA
,nf2
,nf5
,mf2
)
20 integer :: array1(nx
,ny
), array2(nx
,ny
)
21 data array2
/ 1,2,3,4, 10,20,30,40, 100,200,300,400 /
23 call PR38852(IDA
,DDA
,2,5,-2)
24 call PR39006(array1
, array2(:,ny
:1:-1))
25 call mikael
! http://gcc.gnu.org/ml/fortran/2009-01/msg00342.html
27 subroutine PR39006(array1
, array2
)
28 integer, intent(in
) :: array1(:,:), array2(:,:)
30 do j
= 1, ubound(array2
,2)
31 if (any (array1(:,j
) .ne
. array2(:,4-j
))) call abort
36 SUBROUTINE PR38852(IDA
,DDA
,nf2
,nf5
,mf2
)
42 DLA
=> DDA(2:3, 1:3:2, 5:4:-1, NF2
, NF5
:NF2
:MF2
)
44 if (any(ida
/= 2)) call abort
45 DLA
=> DDA(2:3, 1:3:2, 5:4:-1, 2, 5:2:-2)
47 if (any(ida
/= 2)) call abort
51 DLA
=> DDA(2:3, 1:3:2, 5:4:-1, 2, 5:2:-2)
53 if (any(ida
/= 2)) call abort
54 DLA
=> DDA(2:3, 1:3:2, 5:4:-1, 2, 5:2:-2)
56 if (any(ida
/= 1)) call abort
66 subroutine test (a
, b
, expect
)
67 integer :: a
, b
, expect
69 if (ubound (c
, 1) .ne
. expect
) call abort