fix pr/45972
[official-gcc.git] / gcc / testsuite / gfortran.dg / bounds_check_7.f90
blobc488a68cadc6f3ff3634453e6ccef2983c22b870
1 ! { dg-do run }
2 ! { dg-options "-fbounds-check" }
3 ! { dg-shouldfail "Array reference out of bounds" }
4 ! PR fortran/31627
5 subroutine foo(a)
6 integer a(*), i
7 i = 0
8 a(i) = 42 ! {
9 end subroutine foo
11 program test
12 integer x(42)
13 call foo(x)
14 end program test
15 ! { dg-output "Index '0' of dimension 1 of array 'a' below lower bound of 1" }