2014-04-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / inline_sum_5.f90
blobbda73fd99a3f8a56eb97f63a0645fe67ef2a6952
1 ! { dg-do run }
3 ! PR fortran/57798
4 ! The call to sum used to be inlined into a loop with an uninitialized bound
6 ! Original testcase by Stephan Kramer <stephan.kramer@imperial.ac.uk>
8 program test
9 implicit none
11 call sub(2, 11)
13 contains
15 function func(m, n)
16 integer, intent(in):: m,n
17 real, dimension(m, n):: func
19 func = 1.0
21 end function func
23 subroutine sub(m, n)
24 integer, intent(in):: m, n
25 real, dimension(m,n):: y
27 y = 1.0
28 if (any(sum(y*func(m,n), dim=1) /= m)) call abort
30 end subroutine sub
32 end program test