Plugins: Add label-text.h to CPPLIB_H so it will be installed [PR115288]
[official-gcc.git] / gcc / testsuite / gfortran.dg / do_subscript_3.f90
blob8f7183eb9b62a9a69cb1484bf60651aea74c2f14
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.
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