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_mmval.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 the MINVAL and MAXVAL intrinsics
2
program testmmval
3
   implicit none
4
   integer, dimension (3, 3) :: a
5
   integer, dimension (3) :: b
6
   logical, dimension (3, 3) :: m, tr
7
   integer i
8
   character (len=9) line
9
 
10
   a = reshape ((/1, 2, 3, 5, 4, 6, 9, 8, 7/), (/3, 3/));
11
 
12
   tr = .true.
13
 
14
   b = minval (a, 1)
15
   if (any(b .ne. (/1, 4, 7/))) call abort
16
   write (line, 9000) minval (a, 1)
17
   if (line .ne. '  1  4  7') call abort
18
 
19
   m = .true.
20
   m(1, 1) = .false.
21
   m(1, 2) = .false.
22
   b = minval (a, 1, m)
23
   if (any(b .ne. (/2, 4, 7/))) call abort
24
   b = minval (a, 1, m .and. tr)
25
   if (any(b .ne. (/2, 4, 7/))) call abort
26
   write (line, 9000) minval(a, 1, m)
27
   if (line .ne. '  2  4  7') call abort
28
 
29
   b = maxval (a, 1)
30
   if (any(b .ne. (/3, 6, 9/))) call abort
31
   write (line, 9000) maxval (a, 1)
32
   if (line .ne. '  3  6  9') call abort
33
 
34
   m = .true.
35
   m(1, 2) = .false.
36
   m(1, 3) = .false.
37
   b = maxval (a, 1, m)
38
   if (any(b .ne. (/3, 6, 8/))) call abort
39
   b = maxval (a, 1, m .and. tr)
40
   if (any(b .ne. (/3, 6, 8/))) call abort
41
   write (line, 9000) maxval(a, 1, m)
42
   if (line .ne. '  3  6  8') call abort
43
 
44
9000 format(3I3)
45
end program

powered by: WebSVN 2.1.0

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