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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-require-effective-target fortran_large_int }
3
! Program to test the UNPACK intrinsic for a long integer type
4
program intrinsic_unpack
5
   implicit none
6
   integer,parameter :: k = selected_int_kind (range (0_8) + 1)
7
   integer(kind=k), dimension(3, 3) :: ak, bk
8
   logical, dimension(3, 3) :: mask
9
   character(len=100) line1, line2
10
   integer i
11
 
12
   mask = reshape ((/.false.,.true.,.false.,.true.,.false.,.false.,&
13
                    &.false.,.false.,.true./), (/3, 3/));
14
 
15
   ak = reshape ((/1, 0, 0, 0, 1, 0, 0, 0, 1/), (/3, 3/));
16
   bk = unpack ((/2_k, 3_k, 4_k/), mask, ak)
17
   if (any (bk .ne. reshape ((/1, 2, 0, 3, 1, 0, 0, 0, 4/), (/3, 3/)))) &
18
      call abort
19
   write (line1,'(10I4)') bk
20
   write (line2,'(10I4)') unpack((/2_k, 3_k, 4_k/), mask, ak)
21
   if (line1 .ne. line2) call abort
22
   bk = -1
23
   bk = unpack ((/2_k, 3_k, 4_k/), mask, 0_k)
24
   if (any (bk .ne. reshape ((/0, 2, 0, 3, 0, 0, 0, 0, 4/), (/3, 3/)))) &
25
      call abort
26
 
27
end program

powered by: WebSVN 2.1.0

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