Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / OpenMP / reduction09.f90
blob095b49ba0c400f2a9b7830cb1838dcad1a486782
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 !DEF: /omp_reduction MainProgram
5 program omp_reduction
6 !DEF: /omp_reduction/i ObjectEntity INTEGER(4)
7 integer i
8 !DEF: /omp_reduction/k ObjectEntity INTEGER(4)
9 integer :: k = 10
10 !DEF: /omp_reduction/a ObjectEntity INTEGER(4)
11 integer a(10)
12 !DEF: /omp_reduction/b ObjectEntity INTEGER(4)
13 integer b(10,10,10)
15 !$omp parallel shared(k)
16 !$omp do reduction(+:k)
17 !DEF: /omp_reduction/OtherConstruct1/OtherConstruct1/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
18 do i=1,10
19 !DEF: /omp_reduction/OtherConstruct1/OtherConstruct1/k (OmpReduction) HostAssoc INTEGER(4)
20 k = k+1
21 end do
22 !$omp end do
23 !$omp end parallel
26 !$omp parallel do reduction(+:a(10))
27 !DEF: /omp_reduction/OtherConstruct2/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
28 do i=1,10
29 !REF: /omp_reduction/k
30 k = k+1
31 end do
32 !$omp end parallel do
35 !$omp parallel do reduction(+:a(1:10:1))
36 !DEF: /omp_reduction/OtherConstruct3/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
37 do i=1,10
38 !REF: /omp_reduction/k
39 k = k+1
40 end do
41 !$omp end parallel do
43 !$omp parallel do reduction(+:b(1:10:1,1:5,2))
44 !DEF: /omp_reduction/OtherConstruct4/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
45 do i=1,10
46 !REF: /omp_reduction/k
47 k = k+1
48 end do
49 !$omp end parallel do
51 !$omp parallel do reduction(+:b(1:10:1,1:5,2:5:1))
52 !DEF: /omp_reduction/OtherConstruct5/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
53 do i=1,10
54 !REF: /omp_reduction/k
55 k = k+1
56 end do
57 !$omp end parallel do
59 !$omp parallel private(i)
60 !$omp do reduction(+:k) reduction(+:j)
61 !DEF: /omp_reduction/OtherConstruct6/OtherConstruct1/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
62 do i=1,10
63 !DEF: /omp_reduction/OtherConstruct6/OtherConstruct1/k (OmpReduction) HostAssoc INTEGER(4)
64 k = k+1
65 end do
66 !$omp end do
67 !$omp end parallel
69 !$omp do reduction(+:k) reduction(*:j) reduction(+:l)
70 !DEF: /omp_reduction/OtherConstruct7/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
71 do i=1,10
72 !DEF: /omp_reduction/OtherConstruct7/k (OmpReduction) HostAssoc INTEGER(4)
73 k = k+1
74 end do
75 !$omp end do
78 !$omp do reduction(.and.:k) reduction(.or.:j) reduction(.eqv.:l)
79 !DEF: /omp_reduction/OtherConstruct8/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
80 do i=1,10
81 !DEF: /omp_reduction/OtherConstruct8/k (OmpReduction) HostAssoc INTEGER(4)
82 k = k+1
83 end do
84 !$omp end do
86 end program omp_reduction