2008-07-06 Kai Tietz <kai.tietz@onevision.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / minmaxloc_4.f90
blob2ea2e7b86abd3cb7f91c98858e0ecab78fcb397c
1 ! { dg-do run }
2 ! Test to make sure that PR 33354 remains fixed and doesn't regress
3 PROGRAM TST
4 IMPLICIT NONE
5 REAL :: A(1,3)
6 REAL :: B(3,1)
7 A(:,1) = 10
8 A(:,2) = 20
9 A(:,3) = 30
11 !WRITE(*,*) SUM(A(:,1:3),1)
12 !WRITE(*,*) MINLOC(SUM(A(:,1:3),1),1)
13 if (minloc(sum(a(:,1:3),1),1) .ne. 1) call abort()
14 if (maxloc(sum(a(:,1:3),1),1) .ne. 3) call abort()
16 B(1,:) = 10
17 B(2,:) = 20
18 B(3,:) = 30
19 if (minloc(sum(b(1:3,:),2),2) .ne. 1) call abort()
20 if (maxloc(sum(b(1:3,:),2),2) .ne. 3) call abort()
21 END PROGRAM TST