summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.31.2.f90
blob: f78188c7c28c8c449587ed42dcc51c456c247d48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
! { dg-do compile }

       SUBROUTINE A31_2 (A, B, X, Y, N)
         INTEGER N
         REAL X(*), Y(*), A, B, A_P, B_P
!$OMP PARALLEL SHARED(X, Y, N, A, B) PRIVATE(A_P, B_P)
        A_P = 0.0
        B_P = HUGE(B_P)
!$OMP DO PRIVATE(I)
        DO I=1,N
          A_P = A_P + X(I)
          B_P = MIN(B_P, Y(I))
        ENDDO
!$OMP END DO
!$OMP CRITICAL
          A = A + A_P
          B = MIN(B, B_P)
!$OMP END CRITICAL
!$OMP END PARALLEL
      END SUBROUTINE A31_2