Debian Codegraph @

flang/test/Parser/OpenMP/order-clause01.f90

raw
1 ! RUN: %flang_fc1 -fdebug-unparse -fopenmp %s | FileCheck --ignore-case %s
2 ! RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp %s | FileCheck --check-prefix="PARSE-TREE" %s
3
4 ! Check for ORDER([order-modifier :]concurrent) clause on OpenMP constructs
5
6 subroutine test_do_order()
7 integer :: i, j = 1
8 !CHECK: !$omp do order(concurrent)
9 !$omp do order(concurrent)
10 do i=1,10
11 j = j + 1
12 end do
13 !$omp end do
14 end subroutine
15
16 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
17 !PARSE-TREE-NEXT: OmpBeginLoopDirective
18 !PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = do
19 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
20 !PARSE-TREE-NEXT: Type = Concurrent
21
22 subroutine test_simd_order_reproducible()
23 integer :: i, j = 1
24 !CHECK: !$omp simd order(reproducible:concurrent)
25 !$omp simd order(reproducible:concurrent)
26 do i=1,10
27 j = j + 1
28 end do
29 !$omp end simd
30 end subroutine
31
32 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
33 !PARSE-TREE-NEXT: OmpBeginLoopDirective
34 !PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = simd
35 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
36 !PARSE-TREE-NEXT: Kind = Reproducible
37 !PARSE-TREE-NEXT: Type = Concurrent
38
39 subroutine test_do_simd_order_unconstrained()
40 integer :: i, j = 1
41 !CHECK: !$omp do simd order(unconstrained:concurrent)
42 !$omp do simd order(unconstrained:concurrent)
43 do i=1,10
44 j = j + 1
45 end do
46 !$omp end do simd
47 end subroutine
48
49 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
50 !PARSE-TREE-NEXT: OmpBeginLoopDirective
51 !PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = do simd
52 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
53 !PARSE-TREE-NEXT: Kind = Unconstrained
54 !PARSE-TREE-NEXT: Type = Concurrent
55
56 subroutine test_parallel_do_order()
57 integer :: i, j = 1
58 !CHECK: !$omp parallel do order(concurrent)
59 !$omp parallel do order(concurrent)
60 do i=1,10
61 j = j + 1
62 end do
63 !$omp end parallel do
64 end subroutine
65
66 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
67 !PARSE-TREE-NEXT: OmpBeginLoopDirective
68 !PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = parallel do
69 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
70 !PARSE-TREE-NEXT: Type = Concurrent
71
72 subroutine test_parallel_do_simd_order_reproducible()
73 integer :: i, j = 1
74 !CHECK: !$omp parallel do simd order(reproducible:concurrent)
75 !$omp parallel do simd order(reproducible:concurrent)
76 do i=1,10
77 j = j + 1
78 end do
79 !$omp end parallel do simd
80 end subroutine
81
82 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
83 !PARSE-TREE-NEXT: OmpBeginLoopDirective
84 !PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = parallel do simd
85 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
86 !PARSE-TREE-NEXT: Kind = Reproducible
87 !PARSE-TREE-NEXT: Type = Concurrent
88
89 subroutine test_target_simd_order_unconstrained()
90 integer :: i, j = 1
91 !CHECK: !$omp target simd order(unconstrained:concurrent)
92 !$omp target simd order(unconstrained:concurrent)
93 do i=1,10
94 j = j + 1
95 end do
96 !$omp end target simd
97 end subroutine
98
99 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
100 !PARSE-TREE-NEXT: OmpBeginLoopDirective
101 !PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = target simd
102 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
103 !PARSE-TREE-NEXT: Kind = Unconstrained
104 !PARSE-TREE-NEXT: Type = Concurrent
105
106 subroutine test_target_parallel_do_order()
107 integer :: i, j = 1
108 !CHECK: !$omp target parallel do order(concurrent)
109 !$omp target parallel do order(concurrent)
110 do i=1,10
111 j = j + 1
112 end do
113 !$omp end target parallel do
114 end subroutine
115
116 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
117 !PARSE-TREE-NEXT: OmpBeginLoopDirective
118 !PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = target parallel do
119 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
120 !PARSE-TREE-NEXT: Type = Concurrent
121
122 subroutine test_target_parallel_do_simd_order_reproducible()
123 integer :: i, j = 1
124 !CHECK: !$omp target parallel do simd order(reproducible:concurrent)
125 !$omp target parallel do simd order(reproducible:concurrent)
126 do i=1,10
127 j = j + 1
128 end do
129 !$omp end target parallel do simd
130 end subroutine
131
132 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
133 !PARSE-TREE-NEXT: OmpBeginLoopDirective
134 !PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = target parallel do simd
135 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
136 !PARSE-TREE-NEXT: Kind = Reproducible
137 !PARSE-TREE-NEXT: Type = Concurrent
138
139 subroutine test_teams_distribute_simd_order_unconstrained()
140 integer :: i, j = 1
141 !CHECK: !$omp teams distribute simd order(unconstrained:concurrent)
142 !$omp teams distribute simd order(unconstrained:concurrent)
143 do i=1,10
144 j = j + 1
145 end do
146 !$omp end teams distribute simd
147 end subroutine
148
149 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
150 !PARSE-TREE-NEXT: OmpBeginLoopDirective
151 !PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = teams distribute simd
152 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
153 !PARSE-TREE-NEXT: Kind = Unconstrained
154 !PARSE-TREE-NEXT: Type = Concurrent
155
156 subroutine test_teams_distribute_parallel_do_order()
157 integer :: i, j = 1
158 !CHECK: !$omp teams distribute parallel do order(concurrent)
159 !$omp teams distribute parallel do order(concurrent)
160 do i=1,10
161 j = j + 1
162 end do
163 !$omp end teams distribute parallel do
164 end subroutine
165
166 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
167 !PARSE-TREE-NEXT: OmpBeginLoopDirective
168 !PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = teams distribute parallel do
169 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
170 !PARSE-TREE-NEXT: Type = Concurrent
171
172 subroutine test_teams_distribute_parallel_do_simd_order_reproducible()
173 integer :: i, j = 1
174 !CHECK: !$omp teams distribute parallel do simd order(reproducible:concurrent)
175 !$omp teams distribute parallel do simd order(reproducible:concurrent)
176 do i=1,10
177 j = j + 1
178 end do
179 !$omp end teams distribute parallel do simd
180 end subroutine
181
182 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
183 !PARSE-TREE-NEXT: OmpBeginLoopDirective
184 !PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = teams distribute parallel do simd
185 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
186 !PARSE-TREE-NEXT: Kind = Reproducible
187 !PARSE-TREE-NEXT: Type = Concurrent
188
189 subroutine test_target_teams_distribute_simd_order_unconstrained()
190 integer :: i, j = 1
191 !CHECK: !$omp target teams distribute simd order(unconstrained:concurrent)
192 !$omp target teams distribute simd order(unconstrained:concurrent)
193 do i=1,10
194 j = j + 1
195 end do
196 !$omp end target teams distribute simd
197 end subroutine
198
199 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
200 !PARSE-TREE-NEXT: OmpBeginLoopDirective
201 !PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = target teams distribute simd
202 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
203 !PARSE-TREE-NEXT: Kind = Unconstrained
204 !PARSE-TREE-NEXT: Type = Concurrent
205
206 subroutine test_target_teams_distribute_parallel_do_order()
207 integer :: i, j = 1
208 !CHECK: !$omp target teams distribute parallel do order(concurrent)
209 !$omp target teams distribute parallel do order(concurrent)
210 do i=1,10
211 j = j + 1
212 end do
213 !$omp end target teams distribute parallel do
214 end subroutine
215
216 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
217 !PARSE-TREE-NEXT: OmpBeginLoopDirective
218 !PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = target teams distribute parallel do
219 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
220 !PARSE-TREE-NEXT: Type = Concurrent
221
222 subroutine test_target_teams_distribute_parallel_do_simd_order_reproducible()
223 integer :: i, j = 1
224 !CHECK: !$omp target teams distribute parallel do simd order(reproducible:concurrent)
225 !$omp target teams distribute parallel do simd order(reproducible:concurrent)
226 do i=1,10
227 j = j + 1
228 end do
229 !$omp end target teams distribute parallel do simd
230 end subroutine
231
232 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
233 !PARSE-TREE-NEXT: OmpBeginLoopDirective
234 !PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = target teams distribute parallel do simd
235 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
236 !PARSE-TREE-NEXT: Kind = Reproducible
237 !PARSE-TREE-NEXT: Type = Concurrent
238
239 subroutine test_taskloop_simd_order_unconstrained()
240 integer :: i, j = 1
241 !CHECK: !$omp taskloop simd order(unconstrained:concurrent)
242 !$omp taskloop simd order(unconstrained:concurrent)
243 do i=1,10
244 j = j + 1
245 end do
246 !$omp end taskloop simd
247 end subroutine
248
249 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
250 !PARSE-TREE-NEXT: OmpBeginLoopDirective
251 !PARSE-TREE-NEXT: OmpLoopDirective -> llvm::omp::Directive = taskloop simd
252 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
253 !PARSE-TREE-NEXT: Kind = Unconstrained
254 !PARSE-TREE-NEXT: Type = Concurrent