gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_mmloc_2.f90
raw| 1 | program 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) STOP 1 |
| 14 | if (maxloc (b, 1) .ne. 1) STOP 2 |
| 15 | if (maxloc (c, 1) .ne. 1) STOP 3 |
| 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) STOP 4 |
| 22 | END PROGRAM |