aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-02-09 09:41:49 +0000
committerDuncan Sands <baldrick@free.fr>2009-02-09 09:41:49 +0000
commit36abd31837a4b205baae10612fd6c1d13f682257 (patch)
tree459bc43f7241785fe725210d5188c6b016ab6c20 /test
parent23cf3d1d824dc7938ca893fd6bfee3d386ed0b89 (diff)
downloadexternal_llvm-36abd31837a4b205baae10612fd6c1d13f682257.zip
external_llvm-36abd31837a4b205baae10612fd6c1d13f682257.tar.gz
external_llvm-36abd31837a4b205baae10612fd6c1d13f682257.tar.bz2
Testcase for PR2437.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64131 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/FrontendFortran/2009-02-09-FloorDivExpr.f9032
1 files changed, 32 insertions, 0 deletions
diff --git a/test/FrontendFortran/2009-02-09-FloorDivExpr.f90 b/test/FrontendFortran/2009-02-09-FloorDivExpr.f90
new file mode 100644
index 0000000..870e99b
--- /dev/null
+++ b/test/FrontendFortran/2009-02-09-FloorDivExpr.f90
@@ -0,0 +1,32 @@
+! RUN: %llvmgcc -c %s
+! PR2437
+program main
+ implicit none
+ call build (77)
+contains
+ subroutine build (order)
+ integer :: order, i, j
+
+
+ call test (1, order, 3, (/ (i, i = 1, order, 3) /))
+ call test (order, 1, -3, (/ (i, i = order, 1, -3) /))
+
+ do j = -10, 10
+ call test (order + j, order, 5, (/ (i, i = order + j, order, 5) /))
+ call test (order + j, order, -5, (/ (i, i = order + j, order, -5) /))
+ end do
+
+ end subroutine build
+
+ subroutine test (from, to, step, values)
+ integer, dimension (:) :: values
+ integer :: from, to, step, last, i
+
+ last = 0
+ do i = from, to, step
+ last = last + 1
+ if (values (last) .ne. i) call abort
+ end do
+ if (size (values, dim = 1) .ne. last) call abort
+ end subroutine test
+end program main