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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [compile/] [nested.f90] - Blame information for rev 404

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

Line No. Rev Author Line
1 303 jeremybenn
! Program to test the nested functions
2
program intrinsic_pack
3
   integer, parameter :: val(9) = (/0,0,0,0,9,0,0,0,7/)
4
   integer, dimension(3, 3) :: a
5
   integer, dimension(6) :: b
6
 
7
   a = reshape (val, (/3, 3/))
8
   b = 0
9
   b(1:6:3) = pack (a, a .ne. 0);
10
   if (any (b(1:6:3) .ne. (/9, 7/))) call abort
11
   b = pack (a(2:3, 2:3), a(2:3, 2:3) .ne. 0, (/1, 2, 3, 4, 5, 6/));
12
   if (any (b .ne. (/9, 7, 3, 4, 5, 6/))) call abort
13
 
14
contains
15
  subroutine tests_with_temp
16
    ! A few tests which involve a temporary
17
    if (any (pack(a, a.ne.0) .ne. (/9, 7/))) call abort
18
    if (any (pack(a, .true.) .ne. val)) call abort
19
    if (size(pack (a, .false.)) .ne. 0) call abort
20
    if (any (pack(a, .false., (/1,2,3/)).ne. (/1,2,3/))) call abort
21
 
22
  end subroutine tests_with_temp
23
end program

powered by: WebSVN 2.1.0

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