OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [array_constructor_12.f90] - Blame information for rev 853

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
! Like array_constructor_6.f90, but check integer(8) iterators.
2
! { dg-do run }
3
program main
4
  integer (kind = 8) :: i, l8, u8, step8
5
  integer (kind = 4) :: l4, step4
6
  integer (kind = 8), parameter :: big = 10000000000_8
7
 
8
  l4 = huge (1)
9
  u8 = l4 + 10_8
10
  step4 = 2
11
  call test ((/ (i, i = l4, u8, step4) /), l4 + 0_8, u8, step4 + 0_8)
12
 
13
  l8 = big
14
  u8 = big * 20
15
  step8 = big
16
  call test ((/ (i, i = l8, u8, step8) /), l8, u8, step8)
17
 
18
  u8 = big + 100
19
  l8 = big
20
  step4 = -20
21
  call test ((/ (i, i = u8, l8, step4) /), u8, l8, step4 + 0_8)
22
 
23
  u8 = big * 40
24
  l8 = big * 20
25
  step8 = -big * 2
26
  call test ((/ (i, i = u8, l8, step8) /), u8, l8, step8)
27
 
28
  u8 = big
29
  l4 = big / 100
30
  step4 = -big / 500
31
  call test ((/ (i, i = u8, l4, step4) /), u8, l4 + 0_8, step4 + 0_8)
32
 
33
  u8 = big * 40 + 200
34
  l4 = 200
35
  step8 = -big
36
  call test ((/ (i, i = u8, l4, step8) /), u8, l4 + 0_8, step8)
37
contains
38
  subroutine test (a, l, u, step)
39
    integer (kind = 8), dimension (:), intent (in) :: a
40
    integer (kind = 8), intent (in) :: l, u, step
41
    integer (kind = 8) :: i
42
    integer :: j
43
 
44
    j = 1
45
    do i = l, u, step
46
      if (a (j) .ne. i) call abort
47
      j = j + 1
48
    end do
49
    if (size (a, 1) .ne. j - 1) call abort
50
  end subroutine test
51
end program main

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.