summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.31.1.f90
blob: 7459897ebbdac5e4189146563dc09d4877aee302 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
! { dg-do compile }

      SUBROUTINE A31_1(A, B, X, Y, N)
        INTEGER N
        REAL X(*), Y(*), A, B
!$OMP PARALLEL DO PRIVATE(I) SHARED(X, N) REDUCTION(+:A) &
!$OMP& REDUCTION(MIN:B)
        DO I=1,N
           A = A + X(I)
           B = MIN(B, Y(I))
!  Note that some reductions can be expressed in
!  other forms. For example, the MIN could be expressed as
!  IF (B > Y(I)) B = Y(I)
         END DO
      END SUBROUTINE A31_1