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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [constructor.f90] - Blame information for rev 707

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

Line No. Rev Author Line
1 695 jeremybenn
! Program to test array constructors
2
program constructors
3
   integer, dimension (4) :: a
4
   integer, dimension (3, 2) :: b
5
   integer i, j, k, l, m, n
6
 
7
   a = (/1, (i,i=2,4)/)
8
   do i = 1, 4
9
      if (a(i) .ne. i) call abort
10
   end do
11
 
12
   b = reshape ((/0, 1, 2, 3, 4, 5/), (/3, 2/)) + 1
13
   do i=1,3
14
      if (b(i, 1) .ne. i) call abort
15
      if (b(i, 2) .ne. i + 3) call abort
16
   end do
17
 
18
   k = 1
19
   l = 2
20
   m = 3
21
   n = 4
22
   ! The remainder assumes constant constructors work ok.
23
   a = (/n, m, l, k/)
24
   if (any (a .ne. (/4, 3, 2, 1/))) call abort
25
   a = (/((/i+10, 42/), i = k, l)/)
26
   if (any (a .ne. (/11, 42, 12, 42/))) call abort
27
   a = (/(I, I=k,l) , (J, J=m,n)/)
28
   if (any (a .ne. (/1, 2, 3, 4/))) call abort
29
end program

powered by: WebSVN 2.1.0

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