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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [array_constructor_7.f90] - Blame information for rev 774

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

Line No. Rev Author Line
1 694 jeremybenn
! Like array_constructor_6.f90, but test for nested iterators.
2
! { dg-do run }
3
program main
4
  implicit none
5
  call build (17)
6
contains
7
  subroutine build (order)
8
    integer :: order, i, j
9
 
10
    call test (order, (/ (((j + 100) * i, j = 1, i), i = 1, order) /))
11
    call test (9, (/ (((j + 100) * i, j = 1, i), i = 1, 9) /))
12
    call test (3, (/ 101, 202, 204, 303, 306, 309 /))
13
  end subroutine build
14
 
15
  subroutine test (order, values)
16
    integer, dimension (:) :: values
17
    integer :: order, i, j
18
 
19
    if (size (values, dim = 1) .ne. order * (order + 1) / 2) call abort
20
    do i = 1, order
21
      do j = 1, i
22
        if (values (i * (i - 1) / 2 + j) .ne. (j + 100) * i) call abort
23
      end do
24
    end do
25
  end subroutine test
26
end program main

powered by: WebSVN 2.1.0

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