| 1 |
! { dg-do compile } |
| 2 |
! { dg-additional-options "-Wdo-subscript" } |
| 3 |
! PR 90563 - this used to be rejected, wrongly |
| 4 |
! Original test case by Tobias Neumann |
| 5 |
program test |
| 6 |
implicit none |
| 7 |
integer, parameter :: swap(4) = [2,1,3,4] |
| 8 |
real :: p(20) |
| 9 |
integer :: j |
| 10 |
|
| 11 |
p = 0.0 |
| 12 |
|
| 13 |
! The following warnings are actually bogus, but we are not yet |
| 14 |
! clever enough to suppress them. |
| 15 |
do j=1,6 ! { dg-warning "out of bounds" } |
| 16 |
if (j<5) then |
| 17 |
p(j) = p(swap(j)) ! { dg-warning "out of bounds" } |
| 18 |
endif |
| 19 |
enddo |
| 20 |
end program |