| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-O0" } |
| 3 |
! PR fortran/91424 |
| 4 |
! Check that only one warning is issued inside blocks, and that |
| 5 |
! warnings are also issued for contained subroutines. |
| 6 |
|
| 7 |
program main |
| 8 |
real :: a(5) |
| 9 |
block |
| 10 |
integer :: j |
| 11 |
do j=0, 5 ! { dg-warning "out of bounds" } |
| 12 |
a(j) = 2. ! { dg-warning "out of bounds" } |
| 13 |
end do |
| 14 |
end block |
| 15 |
call x |
| 16 |
contains |
| 17 |
subroutine x |
| 18 |
integer :: i |
| 19 |
do i=1,6 ! { dg-warning "out of bounds" } |
| 20 |
a(i) = 2. ! { dg-warning "out of bounds" } |
| 21 |
end do |
| 22 |
end subroutine x |
| 23 |
end program main |