aboutsummaryrefslogtreecommitdiffstats
path: root/test/FrontendFortran/2009-02-09-FloorDivExpr.f90
blob: ddd05c549496bd08f1b0c98630204b0c6983026b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
! RUN: %llvmgcc -S %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