1 ! REQUIRES: plugins, examples, shell
3 ! RUN: %flang_fc1 -load %llvmshlibdir/flangOmpReport.so -plugin flang-omp-report -fopenmp %s -o - | FileCheck %s
9 integer :: arr(n
,n
), brr(n
,n
), crr(n
,n
)
10 integer :: arr_single(n
),arr_quad(n
,n
,n
,n
)
11 integer :: i
,j
,k
,l
,tmp
,tmp1
,tmp2
15 !Simple check with nowait
21 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
22 ! CHECK-NEXT: line: [[@LINE-6]]
23 ! CHECK-NEXT: construct: do
24 ! CHECK-NEXT: clauses:
25 ! CHECK-NEXT: - clause: nowait
26 ! CHECK-NEXT: details: ''
28 !Check for no effects on loop without nowait
34 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
35 ! CHECK-NEXT: line: [[@LINE-6]]
36 ! CHECK-NEXT: construct: do
37 ! CHECK-NEXT: clauses: []
39 !Check with another construct nested inside loop with nowait
40 !$omp parallel shared(arr)
49 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
50 ! CHECK-NEXT: line: [[@LINE-7]]
51 ! CHECK-NEXT: construct: critical
52 ! CHECK-NEXT: clauses: []
53 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
54 ! CHECK-NEXT: line: [[@LINE-13]]
55 ! CHECK-NEXT: construct: do
56 ! CHECK-NEXT: clauses:
57 ! CHECK-NEXT: - clause: nowait
58 ! CHECK-NEXT: details: ''
59 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
60 ! CHECK-NEXT: line: [[@LINE-20]]
61 ! CHECK-NEXT: construct: parallel
62 ! CHECK-NEXT: clauses:
63 ! CHECK-NEXT: - clause: shared
64 ! CHECK-NEXT: details: arr
66 !Check with back to back loops (one with nowait) inside a parallel construct
67 !$omp parallel shared(arr)
73 !$omp do schedule(guided)
78 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
79 ! CHECK-NEXT: line: [[@LINE-11]]
80 ! CHECK-NEXT: construct: do
81 ! CHECK-NEXT: clauses:
82 ! CHECK-NEXT: - clause: nowait
83 ! CHECK-NEXT: details: ''
84 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
85 ! CHECK-NEXT: line: [[@LINE-12]]
86 ! CHECK-NEXT: construct: do
87 ! CHECK-NEXT: clauses:
88 ! CHECK-NEXT: - clause: schedule
89 ! CHECK-NEXT: details: guided
90 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
91 ! CHECK-NEXT: line: [[@LINE-24]]
92 ! CHECK-NEXT: construct: parallel
93 ! CHECK-NEXT: clauses:
94 ! CHECK-NEXT: - clause: shared
95 ! CHECK-NEXT: details: arr
98 !Check nested parallel do loops with a nowait outside
99 !$omp parallel shared(arr)
115 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
116 ! CHECK-NEXT: line: [[@LINE-10]]
117 ! CHECK-NEXT: construct: critical
118 ! CHECK-NEXT: clauses: []
119 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
120 ! CHECK-NEXT: line: [[@LINE-16]]
121 ! CHECK-NEXT: construct: do
122 ! CHECK-NEXT: clauses: []
123 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
124 ! CHECK-NEXT: line: [[@LINE-21]]
125 ! CHECK-NEXT: construct: parallel
126 ! CHECK-NEXT: clauses: []
127 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
128 ! CHECK-NEXT: line: [[@LINE-28]]
129 ! CHECK-NEXT: construct: do
130 ! CHECK-NEXT: clauses:
131 ! CHECK-NEXT: - clause: nowait
132 ! CHECK-NEXT: details: ''
133 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
134 ! CHECK-NEXT: line: [[@LINE-35]]
135 ! CHECK-NEXT: construct: parallel
136 ! CHECK-NEXT: clauses:
137 ! CHECK-NEXT: - clause: shared
138 ! CHECK-NEXT: details: arr
140 !Check nested parallel do loops with a nowait inside
141 !$omp parallel shared(arr)
157 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
158 ! CHECK-NEXT: line: [[@LINE-10]]
159 ! CHECK-NEXT: construct: critical
160 ! CHECK-NEXT: clauses: []
161 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
162 ! CHECK-NEXT: line: [[@LINE-16]]
163 ! CHECK-NEXT: construct: do
164 ! CHECK-NEXT: clauses:
165 ! CHECK-NEXT: - clause: nowait
166 ! CHECK-NEXT: details: ''
167 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
168 ! CHECK-NEXT: line: [[@LINE-23]]
169 ! CHECK-NEXT: construct: parallel
170 ! CHECK-NEXT: clauses: []
171 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
172 ! CHECK-NEXT: line: [[@LINE-30]]
173 ! CHECK-NEXT: construct: do
174 ! CHECK-NEXT: clauses: []
175 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
176 ! CHECK-NEXT: line: [[@LINE-35]]
177 ! CHECK-NEXT: construct: parallel
178 ! CHECK-NEXT: clauses:
179 ! CHECK-NEXT: - clause: shared
180 ! CHECK-NEXT: details: arr
182 !Check nested parallel do loops with a nowait inside
187 !$omp parallel shared(arr_quad)
188 !$omp do schedule(dynamic)
196 arr_quad(i
,j
,k
,l
) = i
+j
+k
+l
209 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
210 ! CHECK-NEXT: line: [[@LINE-16]]
211 ! CHECK-NEXT: construct: do
212 ! CHECK-NEXT: clauses:
213 ! CHECK-NEXT: - clause: nowait
214 ! CHECK-NEXT: details: ''
215 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
216 ! CHECK-NEXT: line: [[@LINE-23]]
217 ! CHECK-NEXT: construct: parallel
218 ! CHECK-NEXT: clauses: []
219 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
220 ! CHECK-NEXT: line: [[@LINE-29]]
221 ! CHECK-NEXT: construct: do
222 ! CHECK-NEXT: clauses: []
223 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
224 ! CHECK-NEXT: line: [[@LINE-34]]
225 ! CHECK-NEXT: construct: parallel
226 ! CHECK-NEXT: clauses: []
227 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
228 ! CHECK-NEXT: line: [[@LINE-40]]
229 ! CHECK-NEXT: construct: do
230 ! CHECK-NEXT: clauses:
231 ! CHECK-NEXT: - clause: nowait
232 ! CHECK-NEXT: details: ''
233 ! CHECK-NEXT: - clause: schedule
234 ! CHECK-NEXT: details: dynamic
235 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
236 ! CHECK-NEXT: line: [[@LINE-49]]
237 ! CHECK-NEXT: construct: parallel
238 ! CHECK-NEXT: clauses:
239 ! CHECK-NEXT: - clause: shared
240 ! CHECK-NEXT: details: arr_quad
241 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
242 ! CHECK-NEXT: line: [[@LINE-58]]
243 ! CHECK-NEXT: construct: do
244 ! CHECK-NEXT: clauses: []
245 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
246 ! CHECK-NEXT: line: [[@LINE-63]]
247 ! CHECK-NEXT: construct: parallel
248 ! CHECK-NEXT: clauses: []
251 !Check a do simd with nowait
252 !$omp do simd private(tmp)
255 tmp
= arr(i
,j
) + brr(i
,j
)
259 !$omp end do simd nowait
260 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
261 ! CHECK-NEXT: line: [[@LINE-9]]
262 ! CHECK-NEXT: construct: do simd
263 ! CHECK-NEXT: clauses:
264 ! CHECK-NEXT: - clause: nowait
265 ! CHECK-NEXT: details: ''
266 ! CHECK-NEXT: - clause: private
267 ! CHECK-NEXT: details: tmp
270 !test nowait on non-do construct
278 !$omp end single nowait
280 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
281 ! CHECK-NEXT: line: [[@LINE-9]]
282 ! CHECK-NEXT: construct: single
283 ! CHECK-NEXT: clauses: []
284 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
285 ! CHECK-NEXT: line: [[@LINE-9]]
286 ! CHECK-NEXT: construct: single
287 ! CHECK-NEXT: clauses:
288 ! CHECK-NEXT: - clause: nowait
289 ! CHECK-NEXT: details: ''
290 ! CHECK-NEXT:- file: '{{[^"]*}}omp-nowait.f90'
291 ! CHECK-NEXT: line: [[@LINE-20]]
292 ! CHECK-NEXT: construct: parallel
293 ! CHECK-NEXT: clauses: []