OSDN Git Service

* gfortran.h (struct gfc_symbol): Add equiv_built.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.fortran-torture / execute / intrinsic_sum.f90
1 ! Program to test the FORALL construct
2 program testforall
3    implicit none
4    integer, dimension (3, 3) :: a
5    integer, dimension (3) :: b
6    logical, dimension (3, 3) :: m
7    integer i
8
9    a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/));
10
11    if (sum(a) .ne. 45) call abort
12    b = sum (a, 1)
13    if (b(1) .ne. 6) call abort
14    if (b(2) .ne. 15) call abort
15    if (b(3) .ne. 24) call abort
16
17    m = .true.
18    m(1, 1) = .false.
19    m(2, 1) = .false.
20
21    if (sum (a, mask=m) .ne. 42) call abort
22    b = sum (a, 2, m)
23    if (b(1) .ne. 11) call abort
24    if (b(2) .ne. 13) call abort
25    if (b(3) .ne. 18) call abort
26 end program