]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_product.f90
Merge tree-ssa-20020619-branch into mainline.
[thirdparty/gcc.git] / gcc / testsuite / gfortran.fortran-torture / execute / intrinsic_product.f90
1 ! Program to test the PRODUCT intrinsic
2 program testproduct
3 implicit none
4 integer, dimension (3, 3) :: a
5 integer, dimension (3) :: b
6 logical, dimension (3, 3) :: m
7
8 a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/));
9
10 b = product (a, 1)
11
12 if (any(b .ne. (/6, 120, 504/))) call abort
13
14 if (product (a) .ne. 362880) call abort
15
16 m = .true.
17 m(1, 1) = .false.
18 m(2, 1) = .false.
19 b = product (a, 2, m)
20
21 if (any(b .ne. (/28, 40, 162/))) call abort
22
23 if (product (a, mask=m) .ne. 181440) call abort
24
25 end program