Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gfortran.fortran-torture / execute / intrinsic_mmval.f90
blobcfd1a5b2d743085297d7666f9bc0f74d10974962
1 ! 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
10 a = reshape ((/1, 2, 3, 5, 4, 6, 9, 8, 7/), (/3, 3/));
12 tr = .true.
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
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
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
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
44 9000 format(3I3)
45 end program