OSDN Git Service

PR c++/9335
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / minmaxloc_4.f90
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
10
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()
15
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