modula2: Simplify REAL/LONGREAL/SHORTREAL node creation.
[official-gcc.git] / gcc / testsuite / gfortran.dg / inline_sum_5.f90
blob916056be4002f2e7530f1577234de364fee3294a
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)) STOP 1
30 end subroutine sub
32 end program test