1program intrinsic_mmloc_2
2  real a(-1:1), b(2:3), c(1:2)
3  integer, dimension(1):: i
4  real (kind = 8), dimension(-1:1) :: vc
5
6  a = 0
7  b = 0
8  c = 0
9  a(-1) = 1
10  b(2) = 1
11  c(1) = 1
12
13  if (maxloc (a, 1) .ne. 1) call abort()
14  if (maxloc (b, 1) .ne. 1) call abort()
15  if (maxloc (c, 1) .ne. 1) call abort()
16
17
18  ! We were giving MINLOC and MAXLOC the wrong return type
19  vc = (/4.0d0, 2.50d1, 1.0d1/)
20  i = minloc (vc)
21  if (i(1) .ne. 1) call abort()
22END PROGRAM
23