PR c/29467
[official-gcc.git] / gcc / testsuite / gfortran.dg / inline_sum_bounds_check_2.f90
blob8de80fdc9f6471a8ebb44e5a1030578ff25cb3a9
1 ! { dg-do run }
2 ! { dg-options "-fbounds-check" }
4 integer, parameter :: nx = 3, ny = 4
6 integer :: i, j, too_big
8 integer, parameter, dimension(nx,ny) :: p = &
9 reshape((/ (i*i, i=1,size(p)) /), shape(p))
11 integer, dimension(nx,ny) :: a
13 integer, dimension(:), allocatable :: c
16 allocate(c(ny))
18 a = p
19 too_big = nx + 1
21 c = sum(a(1:too_big,:),2)
22 end
23 ! { dg-shouldfail "outside of expected range" }