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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 695 jeremybenn
! Program to test the SIZE intrinsics
2
program testsize
3
   implicit none
4
   real, dimension(:, :), allocatable :: a
5
   integer, dimension(5) :: j
6
   integer, dimension(2, 3) :: b
7
   integer i
8
 
9
   if (size (b(2, :), 1) .ne. 3) call abort
10
 
11
   allocate (a(3:8, 5:7))
12
 
13
   ! With one parameter
14
   if (size(a) .ne. 18) call abort
15
 
16
   ! With two parameters, assigning to an array
17
   j = size(a, 1)
18
   if (any (j .ne. (/6, 6, 6, 6, 6/))) call abort
19
 
20
   ! With a variable second parameter
21
   i = 2
22
   i = size(a, i)
23
   if (i .ne. 3) call abort
24
 
25
   call test(a)
26
contains
27
 
28
subroutine test (a)
29
   real, dimension (1:, 1:) :: a
30
   integer i
31
 
32
   i = 2
33
   if ((size(a, 1) .ne. 6) .or. (size(a, i) .ne. 3)) call abort
34
   if (size (a) .ne. 18 ) call abort
35
end subroutine
36
end program
37
 

powered by: WebSVN 2.1.0

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