xref: /llvm-project/flang/test/Semantics/OpenMP/reduction08.f90 (revision 366eade911b54878c9cc1835d2544fb4ba907ef5)
1! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
2! OpenMP Version 4.5
3! 2.15.3.6 Reduction Clause Positive cases
4
5!DEF: /omp_reduction MainProgram
6program omp_reduction
7  !DEF: /omp_reduction/i ObjectEntity INTEGER(4)
8  integer i
9  !DEF: /omp_reduction/k ObjectEntity INTEGER(4)
10  integer :: k = 10
11  !DEF: /omp_reduction/m ObjectEntity INTEGER(4)
12  integer :: m = 12
13  !$omp parallel do  reduction(max:k)
14  !DEF: /omp_reduction/OtherConstruct1/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
15  do i=1,10
16    !DEF: /omp_reduction/OtherConstruct1/k (OmpReduction) HostAssoc INTEGER(4)
17    !DEF: /omp_reduction/max ELEMENTAL, INTRINSIC, PURE (Function) ProcEntity
18    !DEF: /omp_reduction/OtherConstruct1/m HostAssoc INTEGER(4)
19    k = max(k, m)
20  end do
21  !$omp end parallel do
22
23  !$omp parallel do  reduction(min:k)
24  !DEF: /omp_reduction/OtherConstruct2/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
25  do i=1,10
26    !DEF: /omp_reduction/OtherConstruct2/k (OmpReduction) HostAssoc INTEGER(4)
27    !DEF: /omp_reduction/min ELEMENTAL, INTRINSIC, PURE (Function) ProcEntity
28    !DEF: /omp_reduction/OtherConstruct2/m HostAssoc INTEGER(4)
29    k = min(k, m)
30  end do
31  !$omp end parallel do
32
33  !$omp parallel do  reduction(iand:k)
34  !DEF: /omp_reduction/OtherConstruct3/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
35  do i=1,10
36    !DEF: /omp_reduction/OtherConstruct3/k (OmpReduction) HostAssoc INTEGER(4)
37    !DEF: /omp_reduction/iand ELEMENTAL, INTRINSIC, PURE (Function) ProcEntity
38    !DEF: /omp_reduction/OtherConstruct3/m HostAssoc INTEGER(4)
39    k = iand(k, m)
40  end do
41  !$omp end parallel do
42
43  !$omp parallel do  reduction(ior:k)
44  !DEF: /omp_reduction/OtherConstruct4/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
45  do i=1,10
46    !DEF: /omp_reduction/OtherConstruct4/k (OmpReduction) HostAssoc INTEGER(4)
47    !DEF: /omp_reduction/ior ELEMENTAL, INTRINSIC, PURE (Function) ProcEntity
48    !DEF: /omp_reduction/OtherConstruct4/m HostAssoc INTEGER(4)
49    k = ior(k, m)
50  end do
51  !$omp end parallel do
52
53  !$omp parallel do  reduction(ieor:k)
54  !DEF: /omp_reduction/OtherConstruct5/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
55  do i=1,10
56    !DEF: /omp_reduction/OtherConstruct5/k (OmpReduction) HostAssoc INTEGER(4)
57    !DEF: /omp_reduction/ieor ELEMENTAL, INTRINSIC, PURE (Function) ProcEntity
58    !DEF: /omp_reduction/OtherConstruct5/m HostAssoc INTEGER(4)
59    k = ieor(k,m)
60  end do
61  !$omp end parallel do
62
63end program omp_reduction
64