2014-07-12 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / inline_sum_bounds_check_1.f90
blob39984683d4bf23d94ab69dfb7e0b58fd6c584c07
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 :: b
15 allocate(b(nx))
17 a = p
18 too_big = ny + 1
20 b = sum(a(:,1:too_big),2)
21 end
22 ! { dg-shouldfail "outside of expected range" }