aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/inline_sum_5.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gfortran.dg/inline_sum_5.f90')
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.dg/inline_sum_5.f9033
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/inline_sum_5.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/inline_sum_5.f90
new file mode 100644
index 000000000..bda73fd99
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.dg/inline_sum_5.f90
@@ -0,0 +1,33 @@
+! { dg-do run }
+!
+! PR fortran/57798
+! The call to sum used to be inlined into a loop with an uninitialized bound
+!
+! Original testcase by Stephan Kramer <stephan.kramer@imperial.ac.uk>
+
+program test
+ implicit none
+
+ call sub(2, 11)
+
+ contains
+
+ function func(m, n)
+ integer, intent(in):: m,n
+ real, dimension(m, n):: func
+
+ func = 1.0
+
+ end function func
+
+ subroutine sub(m, n)
+ integer, intent(in):: m, n
+ real, dimension(m,n):: y
+
+ y = 1.0
+ if (any(sum(y*func(m,n), dim=1) /= m)) call abort
+
+ end subroutine sub
+
+end program test
+