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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [array_constructor_10.f90] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
! Like array_constructor_6.f90, but check constructors that apply
2
! an elemental function to an array.
3
! { dg-do run }
4
program main
5
  implicit none
6
  call build (200)
7
contains
8
  subroutine build (order)
9
    integer :: order, i
10
 
11
    call test (order, (/ (abs ((/ i, -i, -i * 2 /)), i = 1, order) /))
12
    call test (order, abs ((/ ((/ -i, -i, i * 2 /), i = 1, order) /)))
13
    call test (order, (/ abs ((/ ((/ i, i, -i * 2 /), i = 1, order) /)) /))
14
  end subroutine build
15
 
16
  subroutine test (order, values)
17
    integer, dimension (3:) :: values
18
    integer :: order, i
19
 
20
    if (size (values, dim = 1) .ne. order * 3) call abort
21
    do i = 1, order
22
      if (values (i * 3) .ne. i) call abort
23
      if (values (i * 3 + 1) .ne. i) call abort
24
      if (values (i * 3 + 2) .ne. i * 2) call abort
25
    end do
26
  end subroutine test
27
end program main

powered by: WebSVN 2.1.0

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