| 1 |
! { dg-do compile } |
| 2 |
! Tests the implementation of compile-time shape testing, required to fix |
| 3 |
! PR19015. The functionality of maxloc and friends is tested by existing |
| 4 |
! testcases. |
| 5 |
! |
| 6 |
! Contributed by Thomas Koeing <[email protected]> |
| 7 |
! |
| 8 |
integer, dimension(0:1,0:1) :: n |
| 9 |
integer, dimension(1) :: i |
| 10 |
n = reshape((/1, 2, 3, 4/), shape(n)) |
| 11 |
i = maxloc(n) ! { dg-error "Different shape for array assignment" } |
| 12 |
i = maxloc(n,dim=1) ! { dg-error "Different shape for array assignment" } |
| 13 |
! print *,i |
| 14 |
end program |