OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [intrinsic_unpack.f90] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 303 jeremybenn
! Program to test the UNPACK intrinsic
2
program intrinsic_unpack
3
   integer, dimension(3, 3) :: a, b
4
   logical, dimension(3, 3) :: mask;
5
   character(len=50) line1, line2
6
   integer i
7
 
8
   mask = reshape ((/.false.,.true.,.false.,.true.,.false.,.false.,&
9
                    &.false.,.false.,.true./), (/3, 3/));
10
   a = reshape ((/1, 0, 0, 0, 1, 0, 0, 0, 1/), (/3, 3/));
11
   b = unpack ((/2, 3, 4/), mask, a)
12
   if (any (b .ne. reshape ((/1, 2, 0, 3, 1, 0, 0, 0, 4/), (/3, 3/)))) &
13
      call abort
14
   write (line1,'(10I4)') b
15
   write (line2,'(10I4)') unpack((/2, 3, 4/), mask, a)
16
   if (line1 .ne. line2) call abort
17
   b = -1
18
   b = unpack ((/2, 3, 4/), mask, 0)
19
   if (any (b .ne. reshape ((/0, 2, 0, 3, 0, 0, 0, 0, 4/), (/3, 3/)))) &
20
      call abort
21
end program

powered by: WebSVN 2.1.0

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