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