1 // RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG %s 2>&1 -fopenmp -fopenmp-version=45 | FileCheck %s
3 // RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG %s 2>&1 -fopenmp | FileCheck %s --check-prefix=OMP51
7 // OMP51-LABEL: void target_has_device_addr(int argc)
8 void target_has_device_addr(int argc
) {
10 // OMP51-NEXT: [[#TTD:]]: 5
11 // OMP51-NEXT: [[#TTD+1]]: int x = 5;
12 // OMP51-NEXT: [[#TTD+2]]: x
13 // OMP51-NEXT: [[#TTD+3]]: [B1.[[#TTD+2]]] (ImplicitCastExpr, LValueToRValue, int)
14 // OMP51-NEXT: [[#TTD+4]]: [B1.[[#TTD+6]]]
15 // OMP51-NEXT: [[#TTD+5]]: [B1.[[#TTD+6]]] = [B1.[[#TTD+3]]]
16 // OMP51-NEXT: [[#TTD+6]]: argc
17 // OMP51-NEXT: [[#TTD+7]]: #pragma omp target has_device_addr(x)
18 // OMP51-NEXT: [B1.[[#TTD+5]]]
20 #pragma omp target has_device_addr(x)
23 // OMP51-LABEL: void target_s_has_device_addr(int argc)
24 void target_s_has_device_addr(int argc
) {
25 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
27 // OMP51-DAG: [[#TSB:]]: x
28 // OMP51-DAG: [[#TSB+1]]: [B3.[[#TSB]]] (ImplicitCastExpr, LValueToRValue, int)
29 // OMP51-DAG: [[#TSB+2]]: argc
30 // OMP51-DAG: [[#TSB+3]]: [B3.[[#TSB+2]]] = [B3.[[#TSB+1]]]
32 // OMP51-DAG: [[#TS:]]: cond
33 // OMP51-DAG: [[#TS+1]]: [B1.[[#TS]]] (ImplicitCastExpr, LValueToRValue, int)
34 // OMP51-DAG: [[#TS+2]]: [B1.[[#TS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
35 // OMP51-DAG: [[#TS+3]]: fp
36 // OMP51-DAG: [[#TS+4]]: rd
37 // OMP51-DAG: [[#TS+5]]: lin
38 // OMP51-DAG: [[#TS+6]]: step_sz
39 // OMP51-DAG: [[#TS+7]]: [B1.[[#TS+6]]] (ImplicitCastExpr, LValueToRValue, int)
40 // OMP51-DAG: [[#TS+8]]: [B3.[[#TSB+2]]]
41 // OMP51-DAG: [[#TS+9]]: [B3.[[#TSB]]]
42 // OMP51-DAG: [[#TS+10]]: #pragma omp target simd if(cond) firstprivate(fp) reduction(+: rd) linear(lin: step(step_sz)) has_device_addr(map)
43 // OMP51-DAG: for (int i = 0;
44 // OMP51-DAG: [B3.[[#TSB+3]]];
45 #pragma omp target simd if(cond) firstprivate(fp) reduction(+:rd) linear(lin: step_sz) has_device_addr(map)
46 for (int i
= 0; i
< 10; ++i
)
49 // OMP51-LABEL: void target_t_l_has_device_addr(int argc)
50 void target_t_l_has_device_addr(int argc
) {
51 int x
, cond
, fp
, rd
, map
;
53 // OMP51-DAG: [[#TTDB:]]: x
54 // OMP51-DAG: [[#TTDB+1]]: [B3.[[#TTDB]]] (ImplicitCastExpr, LValueToRValue, int)
55 // OMP51-DAG: [[#TTDB+2]]: argc
56 // OMP51-DAG: [[#TTDB+3]]: [B3.[[#TTDB+2]]] = [B3.[[#TTDB+1]]]
58 // OMP51-DAG: [[#TTD:]]: cond
59 // OMP51-DAG: [[#TTD+1]]: [B1.[[#TTD]]] (ImplicitCastExpr, LValueToRValue, int)
60 // OMP51-DAG: [[#TTD+2]]: [B1.[[#TTD+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
61 // OMP51-DAG: [[#TTD+3]]: fp
62 // OMP51-DAG: [[#TTD+4]]: rd
63 // OMP51-DAG: [[#TTD+5]]: [B3.[[#TTDB+2]]]
64 // OMP51-DAG: [[#TTD+6]]: [B3.[[#TTDB]]]
65 // OMP51-DAG: [[#TTD+7]]: #pragma omp target teams loop if(cond) firstprivate(fp) reduction(+: rd) has_device_addr(map)
66 // OMP51-DAG: for (int i = 0;
67 // OMP51-DAG: [B3.[[#TTDB+3]]];
68 #pragma omp target teams loop if(cond) firstprivate(fp) reduction(+:rd) has_device_addr(map)
69 for (int i
= 0; i
<10; ++i
)
72 // OMP51-LABEL: void target_p_l_has_device_addr(int argc)
73 void target_p_l_has_device_addr(int argc
) {
74 int x
, cond
, fp
, rd
, map
;
75 #pragma omp target parallel loop if(cond) firstprivate(fp) reduction(+:rd) has_device_addr(map)
77 // OMP51-DAG: [[#TTDB:]]: x
78 // OMP51-DAG: [[#TTDB+1]]: [B3.[[#TTDB]]] (ImplicitCastExpr, LValueToRValue, int)
79 // OMP51-DAG: [[#TTDB+2]]: argc
80 // OMP51-DAG: [[#TTDB+3]]: [B3.[[#TTDB+2]]] = [B3.[[#TTDB+1]]]
82 // OMP51-DAG: [[#TTD:]]: cond
83 // OMP51-DAG: [[#TTD+1]]: [B1.[[#TTD]]] (ImplicitCastExpr, LValueToRValue, int)
84 // OMP51-DAG: [[#TTD+2]]: [B1.[[#TTD+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
85 // OMP51-DAG: [[#TTD+3]]: fp
86 // OMP51-DAG: [[#TTD+4]]: rd
87 // OMP51-DAG: [[#TTD+5]]: [B3.[[#TTDB+2]]]
88 // OMP51-DAG: [[#TTD+6]]: [B3.[[#TTDB]]]
89 // OMP51-DAG: [[#TTD+7]]: #pragma omp target parallel loop if(cond) firstprivate(fp) reduction(+: rd) has_device_addr(map)
90 // OMP51-DAG: for (int i = 0;
91 // OMP51-DAG: [B3.[[#TTDB+3]]];
92 for (int i
= 0; i
< 10; ++i
)
100 // OMP51-LABEL: template<> void apply<32U>()
101 template<unsigned int nRHS
>
104 // OMP51-DAG: [[#TTD:]]: 10
105 // OMP51-DAG: [[#TTD+1]]: [B1.[[#TTD:]]] (ImplicitCastExpr, IntegralToFloating, float)
106 // OMP51-DAG: [[#TTD+2]]: this
107 // OMP51-DAG: [[#TTD+3]]: [B1.[[#TTD+2]]]->devPtr
108 // OMP51-DAG: [[#TTD+4]]: [B1.[[#TTD+3]]] = [B1.[[#TTD+1]]]
109 // OMP51-DAG: [[#TTD+5]]: #pragma omp target has_device_addr(this->devPtr) device(this->targetDev)
111 // OMP51-DAG: [B1.[[#TTD+4]]];
112 #pragma omp target has_device_addr(devPtr) device(targetDev)
118 void use_template() {
124 // CHECK-LABEL: void xxx(int argc)
127 // CHECK-NEXT: 1: int x;
128 // CHECK-NEXT: 2: int cond;
129 // CHECK-NEXT: 3: int fp;
130 // CHECK-NEXT: 4: int rd;
131 // CHECK-NEXT: 5: int lin;
132 // CHECK-NEXT: 6: int step_sz;
133 // CHECK-NEXT: 7: int map;
134 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
135 // CHECK-NEXT: [[#ATOM:]]: x
136 // CHECK-NEXT: [[#ATOM+1]]: [B1.[[#ATOM]]] (ImplicitCastExpr, LValueToRValue, int)
137 // CHECK-NEXT: [[#ATOM+2]]: argc
138 // CHECK-NEXT: [[#ATOM+3]]: [B1.[[#ATOM+2]]] = [B1.[[#ATOM+1]]]
139 // CHECK-NEXT: [[#ATOM+4]]: #pragma omp atomic read
140 // CHECK-NEXT: [B1.[[#ATOM+3]]];
141 #pragma omp atomic read
143 // CHECK-NEXT: [[#CRIT:]]: x
144 // CHECK-NEXT: [[#CRIT+1]]: [B1.[[#CRIT]]] (ImplicitCastExpr, LValueToRValue, int)
145 // CHECK-NEXT: [[#CRIT+2]]: argc
146 // CHECK-NEXT: [[#CRIT+3]]: [B1.[[#CRIT+2]]] = [B1.[[#CRIT+1]]]
147 // CHECK-NEXT: [[#CRIT+4]]: #pragma omp critical
148 // CHECK-NEXT: [B1.[[#CRIT+3]]];
151 // CHECK-NEXT: [[#MASTER:]]: x
152 // CHECK-NEXT: [[#MASTER+1]]: [B1.[[#MASTER]]] (ImplicitCastExpr, LValueToRValue, int)
153 // CHECK-NEXT: [[#MASTER+2]]: argc
154 // CHECK-NEXT: [[#MASTER+3]]: [B1.[[#MASTER+2]]] = [B1.[[#MASTER+1]]]
155 // CHECK-NEXT: [[#MASTER+4]]: #pragma omp master
156 // CHECK-NEXT: [B1.[[#MASTER+3]]];
159 // CHECK-NEXT: [[#PAR:]]: x
160 // CHECK-NEXT: [[#PAR+1]]: [B1.[[#PAR]]] (ImplicitCastExpr, LValueToRValue, int)
161 // CHECK-NEXT: [[#PAR+2]]: argc
162 // CHECK-NEXT: [[#PAR+3]]: [B1.[[#PAR+2]]] = [B1.[[#PAR+1]]]
163 // CHECK-NEXT: [[#PAR+4]]: cond
164 // CHECK-NEXT: [[#PAR+5]]: [B1.[[#PAR+4]]] (ImplicitCastExpr, LValueToRValue, int)
165 // CHECK-NEXT: [[#PAR+6]]: [B1.[[#PAR+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
166 // CHECK-NEXT: [[#PAR+7]]: fp
167 // CHECK-NEXT: [[#PAR+8]]: rd
168 // CHECK-NEXT: [[#PAR+9]]: #pragma omp parallel if(cond) firstprivate(fp) reduction(min: rd)
169 // CHECK-NEXT: [B1.[[#PAR+3]]];
170 #pragma omp parallel if(cond) firstprivate(fp) reduction(min:rd)
172 // CHECK-NEXT: [[#PSECT:]]: x
173 // CHECK-NEXT: [[#PSECT+1]]: [B1.[[#PSECT]]] (ImplicitCastExpr, LValueToRValue, int)
174 // CHECK-NEXT: [[#PSECT+2]]: argc
175 // CHECK-NEXT: [[#PSECT+3]]: [B1.[[#PSECT+2]]] = [B1.[[#PSECT+1]]]
176 // CHECK-NEXT: [[#PSECT+4]]: cond
177 // CHECK-NEXT: [[#PSECT+5]]: [B1.[[#PSECT+4]]] (ImplicitCastExpr, LValueToRValue, int)
178 // CHECK-NEXT: [[#PSECT+6]]: [B1.[[#PSECT+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
179 // CHECK-NEXT: [[#PSECT+7]]: fp
180 // CHECK-NEXT: [[#PSECT+8]]: rd
181 // CHECK-NEXT: [[#PSECT+9]]: #pragma omp parallel sections if(cond) firstprivate(fp) reduction(&&: rd)
183 // CHECK-NEXT: [B1.[[#PSECT+3]]];
185 #pragma omp parallel sections if(cond) firstprivate(fp) reduction(&&:rd)
189 // CHECK-NEXT: [[#SINGLE:]]: x
190 // CHECK-NEXT: [[#SINGLE+1]]: [B1.[[#SINGLE]]] (ImplicitCastExpr, LValueToRValue, int)
191 // CHECK-NEXT: [[#SINGLE+2]]: argc
192 // CHECK-NEXT: [[#SINGLE+3]]: [B1.[[#SINGLE+2]]] = [B1.[[#SINGLE+1]]]
193 // CHECK-NEXT: [[#SINGLE+4]]: #pragma omp single
194 // CHECK-NEXT: [B1.[[#SINGLE+3]]];
197 // CHECK-NEXT: [[#TARGET:]]:
198 // CHECK-SAME: [B1.[[#TARGET+10]]]
199 // CHECK-NEXT: [[#TARGET+1]]: [B1.[[#TARGET+10]]] (ImplicitCastExpr, LValueToRValue, int)
200 // CHECK-NEXT: [[#TARGET+2]]: [B1.[[#TARGET+9]]]
201 // CHECK-NEXT: [[#TARGET+3]]: [B1.[[#TARGET+9]]] = [B1.[[#TARGET+1]]]
202 // CHECK-NEXT: [[#TARGET+4]]: cond
203 // CHECK-NEXT: [[#TARGET+5]]: [B1.[[#TARGET+4]]] (ImplicitCastExpr, LValueToRValue, int)
204 // CHECK-NEXT: [[#TARGET+6]]: [B1.[[#TARGET+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
205 // CHECK-NEXT: [[#TARGET+7]]: fp
206 // CHECK-NEXT: [[#TARGET+8]]: rd
207 // CHECK-NEXT: [[#TARGET+9]]: argc
208 // CHECK-NEXT: [[#TARGET+10]]: x
209 // CHECK-NEXT: [[#TARGET+11]]: #pragma omp target depend(in : argc) if(cond) firstprivate(fp) reduction(-: rd)
210 // CHECK-NEXT: [B1.[[#TARGET+3]]];
211 #pragma omp target depend(in \
212 : argc) if(cond) firstprivate(fp) reduction(-:rd)
214 // CHECK-NEXT: [[#TP:]]:
215 // CHECK-SAME: [B1.[[#TP+11]]]
216 // CHECK-NEXT: [[#TP+1]]: [B1.[[#TP+11]]] (ImplicitCastExpr, LValueToRValue, int)
217 // CHECK-NEXT: [[#TP+2]]: [B1.[[#TP+10]]]
218 // CHECK-NEXT: [[#TP+3]]: [B1.[[#TP+10]]] = [B1.[[#TP+1]]]
219 // CHECK-NEXT: [[#TP+4]]: cond
220 // CHECK-NEXT: [[#TP+5]]: [B1.[[#TP+4]]] (ImplicitCastExpr, LValueToRValue, int)
221 // CHECK-NEXT: [[#TP+6]]: [B1.[[#TP+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
222 // CHECK-NEXT: [[#TP+7]]: fp
223 // CHECK-NEXT: [[#TP+8]]: rd
224 // CHECK-NEXT: [[#TP+9]]: map
225 // CHECK-NEXT: [[#TP+10]]: argc
226 // CHECK-NEXT: [[#TP+11]]: x
227 // CHECK-NEXT: [[#TP+12]]: #pragma omp target parallel if(cond) firstprivate(fp) reduction(+: rd) map(to: map)
228 // CHECK-NEXT: [B1.[[#TP+3]]];
229 #pragma omp target parallel if(cond) firstprivate(fp) reduction(+:rd) map(to:map)
231 // CHECK-NEXT: [[#TT:]]:
232 // CHECK-SAME: [B1.[[#TT+11]]]
233 // CHECK-NEXT: [[#TT+1]]: [B1.[[#TT+11]]] (ImplicitCastExpr, LValueToRValue, int)
234 // CHECK-NEXT: [[#TT+2]]: [B1.[[#TT+10]]]
235 // CHECK-NEXT: [[#TT+3]]: [B1.[[#TT+10]]] = [B1.[[#TT+1]]]
236 // CHECK-NEXT: [[#TT+4]]: cond
237 // CHECK-NEXT: [[#TT+5]]: [B1.[[#TT+4]]] (ImplicitCastExpr, LValueToRValue, int)
238 // CHECK-NEXT: [[#TT+6]]: [B1.[[#TT+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
239 // CHECK-NEXT: [[#TT+7]]: fp
240 // CHECK-NEXT: [[#TT+8]]: rd
241 // CHECK-NEXT: [[#TT+9]]: map
242 // CHECK-NEXT: [[#TT+10]]: argc
243 // CHECK-NEXT: [[#TT+11]]: x
244 // CHECK-NEXT: [[#TT+12]]: #pragma omp target teams if(cond) firstprivate(fp) reduction(+: rd) map(tofrom: map)
245 // CHECK-NEXT: [B1.[[#TT+3]]];
246 #pragma omp target teams if(cond) firstprivate(fp) reduction(+:rd) map(tofrom:map)
248 // CHECK-NEXT: [[#TU:]]: cond
249 // CHECK-NEXT: [[#TU+1]]: [B1.[[#TU]]] (ImplicitCastExpr, LValueToRValue, int)
250 // CHECK-NEXT: [[#TU+2]]: [B1.[[#TU+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
251 // CHECK-NEXT: [[#TU+3]]: #pragma omp target update to(x) if(target update: cond)
252 #pragma omp target update to(x) if(target update:cond)
253 // CHECK-NEXT: [[#TASK:]]:
254 // CHECK-SAME: [B1.[[#TASK+9]]]
255 // CHECK-NEXT: [[#TASK+1]]: [B1.[[#TASK+9]]] (ImplicitCastExpr, LValueToRValue, int)
256 // CHECK-NEXT: [[#TASK+2]]: [B1.[[#TASK+8]]]
257 // CHECK-NEXT: [[#TASK+3]]: [B1.[[#TASK+8]]] = [B1.[[#TASK+1]]]
258 // CHECK-NEXT: [[#TASK+4]]: cond
259 // CHECK-NEXT: [[#TASK+5]]: [B1.[[#TASK+4]]] (ImplicitCastExpr, LValueToRValue, int)
260 // CHECK-NEXT: [[#TASK+6]]: [B1.[[#TASK+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
261 // CHECK-NEXT: [[#TASK+7]]: fp
262 // CHECK-NEXT: [[#TASK+8]]: argc
263 // CHECK-NEXT: [[#TASK+9]]: x
264 // CHECK-NEXT: [[#TASK+10]]: #pragma omp task if(cond) firstprivate(fp)
265 // CHECK-NEXT: [B1.[[#TASK+3]]];
266 #pragma omp task if(cond) firstprivate(fp)
268 // CHECK-NEXT: [[#TG:]]: x
269 // CHECK-NEXT: [[#TG+1]]: [B1.[[#TG]]] (ImplicitCastExpr, LValueToRValue, int)
270 // CHECK-NEXT: [[#TG+2]]: argc
271 // CHECK-NEXT: [[#TG+3]]: [B1.[[#TG+2]]] = [B1.[[#TG+1]]]
272 // CHECK-NEXT: [[#TG+4]]: #pragma omp taskgroup
273 // CHECK-NEXT: [B1.[[#TG+3]]];
274 #pragma omp taskgroup
276 // CHECK-NEXT: [[#TEAMS:]]: x
277 // CHECK-NEXT: [[#TEAMS+1]]: [B1.[[#TEAMS]]] (ImplicitCastExpr, LValueToRValue, int)
278 // CHECK-NEXT: [[#TEAMS+2]]: argc
279 // CHECK-NEXT: [[#TEAMS+3]]: [B1.[[#TEAMS+2]]] = [B1.[[#TEAMS+1]]]
280 // CHECK-NEXT: [[#TEAMS+4]]: [B1.[[#TEAMS+7]]]
281 // CHECK-NEXT: [[#TEAMS+5]]: [B1.[[#TEAMS+8]]]
282 // CHECK-NEXT: [[#TEAMS+6]]: #pragma omp teams firstprivate(fp) reduction(+: rd)
283 // CHECK-NEXT: [B1.[[#TEAMS+3]]];
284 // CHECK-NEXT: [[#TEAMS+7]]: fp
285 // CHECK-NEXT: [[#TEAMS+8]]: rd
286 // CHECK-NEXT: [[#TEAMS+9]]: argc
287 // CHECK-NEXT: [[#TEAMS+10]]: x
288 // CHECK-NEXT: [[#TEAMS+11]]: #pragma omp target
290 #pragma omp teams firstprivate(fp) reduction(+:rd)
292 // CHECK-NEXT: [B1.[[#TEAMS+6]]] Preds
295 // CHECK-LABEL: void dpf(int argc)
297 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
299 // CHECK-DAG: [[#DPFB:]]: x
300 // CHECK-DAG: [[#DPFB+1]]: [B3.[[#DPFB]]] (ImplicitCastExpr, LValueToRValue, int)
301 // CHECK-DAG: [[#DPFB+2]]: argc
302 // CHECK-DAG: [[#DPFB+3]]: [B3.[[#DPFB+2]]] = [B3.[[#DPFB+1]]]
304 // CHECK-DAG: [[#DPF:]]: cond
305 // CHECK-DAG: [[#DPF+1]]: [B1.[[#DPF]]] (ImplicitCastExpr, LValueToRValue, int)
306 // CHECK-DAG: [[#DPF+2]]: [B1.[[#DPF+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
307 // CHECK-DAG: [[#DPF+3]]: fp
308 // CHECK-DAG: [[#DPF+4]]: rd
309 // CHECK-DAG: [[#DPF+5]]: #pragma omp distribute parallel for if(parallel: cond) firstprivate(fp) reduction(+: rd)
310 // CHECK-DAG: for (int i = 0;
311 // CHECK-DAG: [B3.[[#DPFB+3]]];
312 #pragma omp distribute parallel for if(parallel:cond) firstprivate(fp) reduction(+:rd)
313 for (int i
= 0; i
< 10; ++i
)
317 // CHECK-LABEL: void dpfs(int argc)
318 void dpfs(int argc
) {
319 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
321 // CHECK-DAG: [[#DPFSB:]]: x
322 // CHECK-DAG: [[#DPFSB+1]]: [B3.[[#DPFSB]]] (ImplicitCastExpr, LValueToRValue, int)
323 // CHECK-DAG: [[#DPFSB+2]]: argc
324 // CHECK-DAG: [[#DPFSB+3]]: [B3.[[#DPFSB+2]]] = [B3.[[#DPFSB+1]]]
326 // CHECK-DAG: [[#DPFS:]]: cond
327 // CHECK-DAG: [[#DPFS+1]]: [B1.[[#DPFS]]] (ImplicitCastExpr, LValueToRValue, int)
328 // CHECK-DAG: [[#DPFS+2]]: [B1.[[#DPFS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
329 // CHECK-DAG: [[#DPFS+3]]: fp
330 // CHECK-DAG: [[#DPFS+4]]: rd
331 // CHECK-DAG: [[#DPFS+5]]: #pragma omp distribute parallel for simd if(cond) firstprivate(fp) reduction(-: rd)
332 // CHECK-DAG: for (int i = 0;
333 // CHECK-DAG: [B3.[[#DPFSB+3]]];
334 #pragma omp distribute parallel for simd if(cond) firstprivate(fp) reduction(-:rd)
335 for (int i
= 0; i
< 10; ++i
)
339 // CHECK-LABEL: void ds(int argc)
341 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
343 // CHECK-DAG: [[#DSB:]]: x
344 // CHECK-DAG: [[#DSB+1]]: [B3.[[#DSB]]] (ImplicitCastExpr, LValueToRValue, int)
345 // CHECK-DAG: [[#DSB+2]]: argc
346 // CHECK-DAG: [[#DSB+3]]: [B3.[[#DSB+2]]] = [B3.[[#DSB+1]]]
348 // CHECK-DAG: [[#DS:]]: #pragma omp distribute simd
349 // CHECK-DAG: for (int i = 0;
350 // CHECK-DAG: [B3.[[#DSB+3]]];
351 #pragma omp distribute simd
352 for (int i
= 0; i
< 10; ++i
)
356 // CHECK-LABEL: void for_fn(int argc)
357 void for_fn(int argc
) {
358 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
360 // CHECK-DAG: [[#FORB:]]: x
361 // CHECK-DAG: [[#FORB+1]]: [B3.[[#FORB]]] (ImplicitCastExpr, LValueToRValue, int)
362 // CHECK-DAG: [[#FORB+2]]: argc
363 // CHECK-DAG: [[#FORB+3]]: [B3.[[#FORB+2]]] = [B3.[[#FORB+1]]]
365 // CHECK-DAG: [[#FOR:]]: lin
366 // CHECK-DAG: [[#FOR+1]]: step_sz
367 // CHECK-DAG: [[#FOR+2]]: [B1.[[#FOR+1]]] (ImplicitCastExpr, LValueToRValue, int)
368 // CHECK-DAG: [[#FOR+3]]: #pragma omp for linear(lin: step(step_sz))
369 // CHECK-DAG: for (int i = 0;
370 // CHECK-DAG: [B3.[[#FORB+3]]];
371 #pragma omp for linear(lin : step_sz)
372 for (int i
= 0; i
< 10; ++i
)
376 // CHECK-LABEL: void fs(int argc)
378 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
380 // CHECK-DAG: [[#FSB:]]: x
381 // CHECK-DAG: [[#FSB+1]]: [B3.[[#FSB]]] (ImplicitCastExpr, LValueToRValue, int)
382 // CHECK-DAG: [[#FSB+2]]: argc
383 // CHECK-DAG: [[#FSB+3]]: [B3.[[#FSB+2]]] = [B3.[[#FSB+1]]]
385 // CHECK-DAG: [[#FS:]]: lin
386 // CHECK-DAG: [[#FS+1]]: step_sz
387 // CHECK-DAG: [[#FS+2]]: [B1.[[#FS+1]]] (ImplicitCastExpr, LValueToRValue, int)
388 // CHECK-DAG: [[#FS+3]]: #pragma omp for simd linear(lin: step(step_sz))
389 // CHECK-DAG: for (int i = 0;
390 // CHECK-DAG: [B3.[[#FSB+3]]];
391 #pragma omp for simd linear(lin: step_sz)
392 for (int i
= 0; i
< 10; ++i
)
396 // CHECK-LABEL: void ord(int argc)
398 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
400 // CHECK-DAG: [[#ORDB:]]: x
401 // CHECK-DAG: [[#ORDB+1]]: [B3.[[#ORDB]]] (ImplicitCastExpr, LValueToRValue, int)
402 // CHECK-DAG: [[#ORDB+2]]: argc
403 // CHECK-DAG: [[#ORDB+3]]: [B3.[[#ORDB+2]]] = [B3.[[#ORDB+1]]]
404 // CHECK-DAG: [[#ORDB+4]]: #pragma omp ordered
405 // CHECK-DAG: [B3.[[#ORDB+3]]];
407 // CHECK-DAG: [[#ORD:]]: #pragma omp for ordered
408 // CHECK-DAG: for (int i = 0
409 // CHECK-DAG:[B3.[[#ORDB+4]]] }
410 #pragma omp for ordered
411 for (int i
= 0; i
< 10; ++i
) {
417 // CHECK-LABEL: void pf(int argc)
419 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
421 // CHECK-DAG: [[#PFB:]]: x
422 // CHECK-DAG: [[#PFB+1]]: [B3.[[#PFB]]] (ImplicitCastExpr, LValueToRValue, int)
423 // CHECK-DAG: [[#PFB+2]]: argc
424 // CHECK-DAG: [[#PFB+3]]: [B3.[[#PFB+2]]] = [B3.[[#PFB+1]]]
426 // CHECK-DAG: [[#PF:]]: cond
427 // CHECK-DAG: [[#PF+1]]: [B1.[[#PF]]] (ImplicitCastExpr, LValueToRValue, int)
428 // CHECK-DAG: [[#PF+2]]: [B1.[[#PF+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
429 // CHECK-DAG: [[#PF+3]]: fp
430 // CHECK-DAG: [[#PF+4]]: rd
431 // CHECK-DAG: [[#PF+5]]: lin
432 // CHECK-DAG: [[#PF+6]]: step_sz
433 // CHECK-DAG: [[#PF+7]]: [B1.[[#PF+6]]] (ImplicitCastExpr, LValueToRValue, int)
434 // CHECK-DAG: [[#PF+8]]: #pragma omp parallel for if(cond) firstprivate(fp) reduction(&: rd) linear(lin: step(step_sz))
435 // CHECK-DAG: for (int i = 0;
436 // CHECK-DAG: [B3.[[#PFB+3]]];
437 #pragma omp parallel for if(cond) firstprivate(fp) reduction(&:rd) linear(lin: step_sz)
438 for (int i
= 0; i
< 10; ++i
)
442 // CHECK-LABEL: void pfs(int argc)
444 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
446 // CHECK-DAG: [[#PFSB:]]: x
447 // CHECK-DAG: [[#PFSB+1]]: [B3.[[#PFSB]]] (ImplicitCastExpr, LValueToRValue, int)
448 // CHECK-DAG: [[#PFSB+2]]: argc
449 // CHECK-DAG: [[#PFSB+3]]: [B3.[[#PFSB+2]]] = [B3.[[#PFSB+1]]]
451 // CHECK-DAG: [[#PFS:]]: cond
452 // CHECK-DAG: [[#PFS+1]]: [B1.[[#PFS]]] (ImplicitCastExpr, LValueToRValue, int)
453 // CHECK-DAG: [[#PFS+2]]: [B1.[[#PFS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
454 // CHECK-DAG: [[#PFS+3]]: fp
455 // CHECK-DAG: [[#PFS+4]]: rd
456 // CHECK-DAG: [[#PFS+5]]: lin
457 // CHECK-DAG: [[#PFS+6]]: step_sz
458 // CHECK-DAG: [[#PFS+7]]: [B1.[[#PFS+6]]] (ImplicitCastExpr, LValueToRValue, int)
459 // CHECK-DAG: [[#PFS+8]]: #pragma omp parallel for simd if(cond) firstprivate(fp) reduction(|: rd) linear(lin: step(step_sz))
460 // CHECK-DAG: for (int i = 0;
461 // CHECK-DAG: [B3.[[#PFSB+3]]];
462 #pragma omp parallel for simd if(cond) firstprivate(fp) reduction(|:rd) linear(lin: step_sz)
463 for (int i
= 0; i
< 10; ++i
)
467 // CHECK-LABEL: void simd(int argc)
468 void simd(int argc
) {
469 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
471 // CHECK-DAG: [[#SIMDB:]]: x
472 // CHECK-DAG: [[#SIMDB+1]]: [B3.[[#SIMDB]]] (ImplicitCastExpr, LValueToRValue, int)
473 // CHECK-DAG: [[#SIMDB+2]]: argc
474 // CHECK-DAG: [[#SIMDB+3]]: [B3.[[#SIMDB+2]]] = [B3.[[#SIMDB+1]]]
476 // CHECK-DAG: [[#SIMD:]]: lin
477 // CHECK-DAG: [[#SIMD+1]]: step_sz
478 // CHECK-DAG: [[#SIMD+2]]: [B1.[[#SIMD+1]]] (ImplicitCastExpr, LValueToRValue, int)
479 // CHECK-DAG: [[#SIMD+3]]: #pragma omp simd linear(lin: step(step_sz))
480 // CHECK-DAG: for (int i = 0;
481 // CHECK-DAG: [B3.[[#SIMDB+3]]];
482 #pragma omp simd linear(lin: step_sz)
483 for (int i
= 0; i
< 10; ++i
)
487 // CHECK-LABEL: void tpf(int argc)
489 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
491 // CHECK-DAG: [[#TPFB:]]: x
492 // CHECK-DAG: [[#TPFB+1]]: [B3.[[#TPFB]]] (ImplicitCastExpr, LValueToRValue, int)
493 // CHECK-DAG: [[#TPFB+2]]: argc
494 // CHECK-DAG: [[#TPFB+3]]: [B3.[[#TPFB+2]]] = [B3.[[#TPFB+1]]]
496 // CHECK-DAG: [[#TPF:]]: cond
497 // CHECK-DAG: [[#TPF+1]]: [B1.[[#TPF]]] (ImplicitCastExpr, LValueToRValue, int)
498 // CHECK-DAG: [[#TPF+2]]: [B1.[[#TPF+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
499 // CHECK-DAG: [[#TPF+3]]: fp
500 // CHECK-DAG: [[#TPF+4]]: rd
501 // CHECK-DAG: [[#TPF+5]]: lin
502 // CHECK-DAG: [[#TPF+6]]: step_sz
503 // CHECK-DAG: [[#TPF+7]]: [B1.[[#TPF+6]]] (ImplicitCastExpr, LValueToRValue, int)
504 // CHECK-DAG: [[#TPF+8]]: map
505 // CHECK-DAG: [[#TPF+9]]: [B3.[[#TPFB+2]]]
506 // CHECK-DAG: [[#TPF+10]]: [B3.[[#TPFB]]]
507 // CHECK-DAG: [[#TPF+11]]: #pragma omp target parallel for if(parallel: cond) firstprivate(fp) reduction(max: rd) linear(lin: step(step_sz)) map(tofrom: map)
508 // CHECK-DAG: for (int i = 0;
509 // CHECK-DAG: [B3.[[#TPFB+3]]];
510 #pragma omp target parallel for if(parallel:cond) firstprivate(fp) reduction(max:rd) linear(lin: step_sz) map(map)
511 for (int i
= 0; i
< 10; ++i
)
515 // CHECK-LABEL: void tpfs(int argc)
516 void tpfs(int argc
) {
517 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
519 // CHECK-DAG: [[#TPFSB:]]: x
520 // CHECK-DAG: [[#TPFSB+1]]: [B3.[[#TPFSB]]] (ImplicitCastExpr, LValueToRValue, int)
521 // CHECK-DAG: [[#TPFSB+2]]: argc
522 // CHECK-DAG: [[#TPFSB+3]]: [B3.[[#TPFSB+2]]] = [B3.[[#TPFSB+1]]]
524 // CHECK-DAG: [[#TPFS:]]: cond
525 // CHECK-DAG: [[#TPFS+1]]: [B1.[[#TPFS]]] (ImplicitCastExpr, LValueToRValue, int)
526 // CHECK-DAG: [[#TPFS+2]]: [B1.[[#TPFS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
527 // CHECK-DAG: [[#TPFS+3]]: fp
528 // CHECK-DAG: [[#TPFS+4]]: rd
529 // CHECK-DAG: [[#TPFS+5]]: lin
530 // CHECK-DAG: [[#TPFS+6]]: step_sz
531 // CHECK-DAG: [[#TPFS+7]]: [B1.[[#TPFS+6]]] (ImplicitCastExpr, LValueToRValue, int)
532 // CHECK-DAG: [[#TPFS+8]]: map
533 // CHECK-DAG: [[#TPFS+9]]: [B3.[[#TPFSB+2]]]
534 // CHECK-DAG: [[#TPFS+10]]: [B3.[[#TPFSB]]]
535 // CHECK-DAG: [[#TPFS+11]]: #pragma omp target parallel for simd if(target: cond) firstprivate(fp) reduction(*: rd) linear(lin: step(step_sz)) map(tofrom: map)
536 // CHECK-DAG: for (int i = 0;
537 // CHECK-DAG: [B3.[[#TPFSB+3]]];
538 #pragma omp target parallel for simd if(target:cond) firstprivate(fp) reduction(*:rd) linear(lin: step_sz) map(tofrom:map)
539 for (int i
= 0; i
< 10; ++i
)
543 // CHECK-LABEL: void ts(int argc)
545 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
547 // CHECK-DAG: [[#TSB:]]: x
548 // CHECK-DAG: [[#TSB+1]]: [B3.[[#TSB]]] (ImplicitCastExpr, LValueToRValue, int)
549 // CHECK-DAG: [[#TSB+2]]: argc
550 // CHECK-DAG: [[#TSB+3]]: [B3.[[#TSB+2]]] = [B3.[[#TSB+1]]]
552 // CHECK-DAG: [[#TS:]]: cond
553 // CHECK-DAG: [[#TS+1]]: [B1.[[#TS]]] (ImplicitCastExpr, LValueToRValue, int)
554 // CHECK-DAG: [[#TS+2]]: [B1.[[#TS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
555 // CHECK-DAG: [[#TS+3]]: fp
556 // CHECK-DAG: [[#TS+4]]: rd
557 // CHECK-DAG: [[#TS+5]]: lin
558 // CHECK-DAG: [[#TS+6]]: step_sz
559 // CHECK-DAG: [[#TS+7]]: [B1.[[#TS+6]]] (ImplicitCastExpr, LValueToRValue, int)
560 // CHECK-DAG: [[#TS+8]]: [B3.[[#TSB+2]]]
561 // CHECK-DAG: [[#TS+9]]: [B3.[[#TSB]]]
562 // CHECK-DAG: [[#TS+10]]: #pragma omp target simd if(cond) firstprivate(fp) reduction(+: rd) linear(lin: step(step_sz)) map(alloc: map)
563 // CHECK-DAG: for (int i = 0;
564 // CHECK-DAG: [B3.[[#TSB+3]]];
565 #pragma omp target simd if(cond) firstprivate(fp) reduction(+:rd) linear(lin: step_sz) map(alloc:map)
566 for (int i
= 0; i
< 10; ++i
)
570 // CHECK-LABEL: void ttd(int argc)
572 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
574 // CHECK-DAG: [[#TTDB:]]: x
575 // CHECK-DAG: [[#TTDB+1]]: [B3.[[#TTDB]]] (ImplicitCastExpr, LValueToRValue, int)
576 // CHECK-DAG: [[#TTDB+2]]: argc
577 // CHECK-DAG: [[#TTDB+3]]: [B3.[[#TTDB+2]]] = [B3.[[#TTDB+1]]]
579 // CHECK-DAG: [[#TTD:]]: cond
580 // CHECK-DAG: [[#TTD+1]]: [B1.[[#TTD]]] (ImplicitCastExpr, LValueToRValue, int)
581 // CHECK-DAG: [[#TTD+2]]: [B1.[[#TTD+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
582 // CHECK-DAG: [[#TTD+3]]: fp
583 // CHECK-DAG: [[#TTD+4]]: rd
584 // CHECK-DAG: [[#TTD+5]]: [B3.[[#TTDB+2]]]
585 // CHECK-DAG: [[#TTD+6]]: [B3.[[#TTDB]]]
586 // CHECK-DAG: [[#TTD+7]]: #pragma omp target teams distribute if(cond) firstprivate(fp) reduction(+: rd) map(alloc: map)
587 // CHECK-DAG: for (int i = 0;
588 // CHECK-DAG: [B3.[[#TTDB+3]]];
589 #pragma omp target teams distribute if(cond) firstprivate(fp) reduction(+:rd) map(alloc:map)
590 for (int i
= 0; i
< 10; ++i
)
594 // CHECK-LABEL: void ttdpf(int argc)
595 void ttdpf(int argc
) {
596 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
598 // CHECK-DAG: [[#TTDPFB:]]: x
599 // CHECK-DAG: [[#TTDPFB+1]]: [B3.[[#TTDPFB]]] (ImplicitCastExpr, LValueToRValue, int)
600 // CHECK-DAG: [[#TTDPFB+2]]: argc
601 // CHECK-DAG: [[#TTDPFB+3]]: [B3.[[#TTDPFB+2]]] = [B3.[[#TTDPFB+1]]]
603 // CHECK-DAG: [[#TTDPF:]]: cond
604 // CHECK-DAG: [[#TTDPF+1]]: [B1.[[#TTDPF]]] (ImplicitCastExpr, LValueToRValue, int)
605 // CHECK-DAG: [[#TTDPF+2]]: [B1.[[#TTDPF+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
606 // CHECK-DAG: [[#TTDPF+3]]: fp
607 // CHECK-DAG: [[#TTDPF+4]]: rd
608 // CHECK-DAG: [[#TTDPF+5]]: [B3.[[#TTDPFB+2]]]
609 // CHECK-DAG: [[#TTDPF+6]]: [B3.[[#TTDPFB]]]
610 // CHECK-DAG: [[#TTDPF+7]]: #pragma omp target teams distribute parallel for if(cond) firstprivate(fp) reduction(+: rd) map(alloc: map)
611 // CHECK-DAG: for (int i = 0;
612 // CHECK-DAG: [B3.[[#TTDPFB+3]]];
613 #pragma omp target teams distribute parallel for if(cond) firstprivate(fp) reduction(+:rd) map(alloc:map)
614 for (int i
= 0; i
< 10; ++i
)
618 // CHECK-LABEL: void ttdpfs(int argc)
619 void ttdpfs(int argc
) {
620 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
622 // CHECK-DAG: [[#TTDPFSB:]]: x
623 // CHECK-DAG: [[#TTDPFSB+1]]: [B3.[[#TTDPFSB]]] (ImplicitCastExpr, LValueToRValue, int)
624 // CHECK-DAG: [[#TTDPFSB+2]]: argc
625 // CHECK-DAG: [[#TTDPFSB+3]]: [B3.[[#TTDPFSB+2]]] = [B3.[[#TTDPFSB+1]]]
627 // CHECK-DAG: [[#TTDPFS:]]: cond
628 // CHECK-DAG: [[#TTDPFS+1]]: [B1.[[#TTDPFS]]] (ImplicitCastExpr, LValueToRValue, int)
629 // CHECK-DAG: [[#TTDPFS+2]]: [B1.[[#TTDPFS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
630 // CHECK-DAG: [[#TTDPFS+3]]: fp
631 // CHECK-DAG: [[#TTDPFS+4]]: rd
632 // CHECK-DAG: [[#TTDPFS+5]]: [B3.[[#TTDPFSB+2]]]
633 // CHECK-DAG: [[#TTDPFS+6]]: [B3.[[#TTDPFSB]]]
634 // CHECK-DAG: [[#TTDPFS+7]]: #pragma omp target teams distribute parallel for simd if(parallel: cond) firstprivate(fp) reduction(+: rd) map(from: map)
635 // CHECK-DAG: for (int i = 0;
636 // CHECK-DAG: [B3.[[#TTDPFSB+3]]];
637 #pragma omp target teams distribute parallel for simd if(parallel:cond) firstprivate(fp) reduction(+:rd) map(from:map)
638 for (int i
= 0; i
< 10; ++i
)
642 // CHECK-LABEL: void ttds(int argc)
643 void ttds(int argc
) {
644 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
646 // CHECK-DAG: [[#TTDSB:]]: x
647 // CHECK-DAG: [[#TTDSB+1]]: [B3.[[#TTDSB]]] (ImplicitCastExpr, LValueToRValue, int)
648 // CHECK-DAG: [[#TTDSB+2]]: argc
649 // CHECK-DAG: [[#TTDSB+3]]: [B3.[[#TTDSB+2]]] = [B3.[[#TTDSB+1]]]
651 // CHECK-DAG: [[#TTDS:]]: cond
652 // CHECK-DAG: [[#TTDS+1]]: [B1.[[#TTDS]]] (ImplicitCastExpr, LValueToRValue, int)
653 // CHECK-DAG: [[#TTDS+2]]: [B1.[[#TTDS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
654 // CHECK-DAG: [[#TTDS+3]]: fp
655 // CHECK-DAG: [[#TTDS+4]]: rd
656 // CHECK-DAG: [[#TTDS+5]]: map
657 // CHECK-DAG: [[#TTDS+6]]: [B3.[[#TTDSB+2]]]
658 // CHECK-DAG: [[#TTDS+7]]: [B3.[[#TTDSB]]]
659 // CHECK-DAG: [[#TTDS+8]]: #pragma omp target teams distribute simd if(cond) firstprivate(fp) reduction(+: rd) map(tofrom: map)
660 // CHECK-DAG: for (int i = 0;
661 // CHECK-DAG: [B3.[[#TTDPFSB+3]]];
662 #pragma omp target teams distribute simd if(cond) firstprivate(fp) reduction(+:rd) map(map)
663 for (int i
= 0; i
< 10; ++i
)
667 // CHECK-LABEL: void tl(int argc)
669 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
671 // CHECK-DAG: [[#TLB:]]: x
672 // CHECK-DAG: [[#TLB+1]]: [B3.[[#TLB]]] (ImplicitCastExpr, LValueToRValue, int)
673 // CHECK-DAG: [[#TLB+2]]: argc
674 // CHECK-DAG: [[#TLB+3]]: [B3.[[#TLB+2]]] = [B3.[[#TLB+1]]]
676 // CHECK-DAG: [[#TL:]]: cond
677 // CHECK-DAG: [[#TL+1]]: [B1.[[#TL]]] (ImplicitCastExpr, LValueToRValue, int)
678 // CHECK-DAG: [[#TL+2]]: [B1.[[#TL+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
679 // CHECK-DAG: [[#TL+3]]: fp
680 // CHECK-DAG: [[#TL+4]]: rd
681 // CHECK-DAG: [[#TL+5]]: [B3.[[#TLB+2]]]
682 // CHECK-DAG: [[#TL+6]]: [B3.[[#TLB]]]
683 // CHECK-DAG: [[#TL+7]]: #pragma omp taskloop if(cond) firstprivate(fp) reduction(+: rd)
684 // CHECK-DAG: for (int i = 0;
685 // CHECK-DAG: [B3.[[#TLB+3]]];
686 #pragma omp taskloop if(cond) firstprivate(fp) reduction(+:rd)
687 for (int i
= 0; i
< 10; ++i
)
691 // CHECK-LABEL: void maskedtaskloop(int argc)
692 void maskedtaskloop(int argc
) {
693 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
695 // CHECK-DAG: [[#MTLB:]]: x
696 // CHECK-DAG: [[#MTLB+1]]: [B3.[[#MTLB]]] (ImplicitCastExpr, LValueToRValue, int)
697 // CHECK-DAG: [[#MTLB+2]]: argc
698 // CHECK-DAG: [[#MTLB+3]]: [B3.[[#MTLB+2]]] = [B3.[[#MTLB+1]]]
700 // CHECK-DAG: [[#MTL:]]: cond
701 // CHECK-DAG: [[#MTL+1]]: [B1.[[#MTL]]] (ImplicitCastExpr, LValueToRValue, int)
702 // CHECK-DAG: [[#MTL+2]]: [B1.[[#MTL+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
703 // CHECK-DAG: [[#MTL+3]]: fp
704 // CHECK-DAG: [[#MTL+4]]: rd
705 // CHECK-DAG: [[#MTL+5]]: [B3.[[#MTLB+2]]]
706 // CHECK-DAG: [[#MTL+6]]: [B3.[[#MTLB]]]
707 // CHECK-DAG: [[#MTL+7]]: #pragma omp masked taskloop if(cond) firstprivate(fp) reduction(+: rd)
708 // CHECK-DAG: for (int i = 0;
709 // CHECK-DAG: [B3.[[#MTLB+3]]];
710 #pragma omp masked taskloop if(cond) firstprivate(fp) reduction(+:rd)
711 for (int i
= 0; i
< 10; ++i
)
715 // CHECK-LABEL: void parallelmaskedtaskloop(int argc)
716 void parallelmaskedtaskloop(int argc
) {
717 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
719 // CHECK-DAG: [[#PMTLB:]]: x
720 // CHECK-DAG: [[#PMTLB+1]]: [B3.[[#PMTLB]]] (ImplicitCastExpr, LValueToRValue, int)
721 // CHECK-DAG: [[#PMTLB+2]]: argc
722 // CHECK-DAG: [[#PMTLB+3]]: [B3.[[#PMTLB+2]]] = [B3.[[#PMTLB+1]]]
724 // CHECK-DAG: [[#PMTL:]]: cond
725 // CHECK-DAG: [[#PMTL+1]]: [B1.[[#PMTL]]] (ImplicitCastExpr, LValueToRValue, int)
726 // CHECK-DAG: [[#PMTL+2]]: [B1.[[#PMTL+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
727 // CHECK-DAG: [[#PMTL+3]]: fp
728 // CHECK-DAG: [[#PMTL+4]]: rd
729 // CHECK-DAG: [[#PMTL+5]]: [B3.[[#PMTLB+2]]]
730 // CHECK-DAG: [[#PMTL+6]]: [B3.[[#PMTLB]]]
731 // CHECK-DAG: [[#PMTL+7]]: #pragma omp parallel masked taskloop if(cond) firstprivate(fp) reduction(+: rd)
732 // CHECK-DAG: for (int i = 0;
733 // CHECK-DAG: [B3.[[#PMTLB+3]]];
734 #pragma omp parallel masked taskloop if(cond) firstprivate(fp) reduction(+:rd)
735 for (int i
= 0; i
< 10; ++i
)
739 // CHECK-LABEL: void parallelmaskedtasksimdloop(int argc)
740 void parallelmaskedtasksimdloop(int argc
) {
741 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
743 // CHECK-DAG: [[#PMTLSB:]]: x
744 // CHECK-DAG: [[#PMTLSB+1]]: [B3.[[#PMTLSB]]] (ImplicitCastExpr, LValueToRValue, int)
745 // CHECK-DAG: [[#PMTLSB+2]]: argc
746 // CHECK-DAG: [[#PMTLSB+3]]: [B3.[[#PMTLSB+2]]] = [B3.[[#PMTLSB+1]]]
748 // CHECK-DAG: [[#PMTLS:]]: cond
749 // CHECK-DAG: [[#PMTLS+1]]: [B1.[[#PMTLS]]] (ImplicitCastExpr, LValueToRValue, int)
750 // CHECK-DAG: [[#PMTLS+2]]: [B1.[[#PMTLS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
751 // CHECK-DAG: [[#PMTLS+3]]: fp
752 // CHECK-DAG: [[#PMTLS+4]]: rd
753 // CHECK-DAG: [[#PMTLS+5]]: [B3.[[#PMTLSB+2]]]
754 // CHECK-DAG: [[#PMTLS+6]]: [B3.[[#PMTLSB]]]
755 // CHECK-DAG: [[#PMTLS+7]]: #pragma omp parallel masked taskloop simd if(cond) firstprivate(fp) reduction(+: rd)
756 // CHECK-DAG: for (int i = 0;
757 // CHECK-DAG: [B3.[[#PMTLSB+3]]];
758 #pragma omp parallel masked taskloop simd if(cond) firstprivate(fp) reduction(+:rd)
759 for (int i
= 0; i
< 10; ++i
)
763 // CHECK-LABEL: void tls(int argc)
765 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
767 // CHECK-DAG: [[#TLSB:]]: x
768 // CHECK-DAG: [[#TLSB+1]]: [B3.[[#TLSB]]] (ImplicitCastExpr, LValueToRValue, int)
769 // CHECK-DAG: [[#TLSB+2]]: argc
770 // CHECK-DAG: [[#TLSB+3]]: [B3.[[#TLSB+2]]] = [B3.[[#TLSB+1]]]
772 // CHECK-DAG: [[#TLS:]]: cond
773 // CHECK-DAG: [[#TLS+1]]: [B1.[[#TLS]]] (ImplicitCastExpr, LValueToRValue, int)
774 // CHECK-DAG: [[#TLS+2]]: [B1.[[#TLS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
775 // CHECK-DAG: [[#TLS+3]]: fp
776 // CHECK-DAG: [[#TLS+4]]: rd
777 // CHECK-DAG: [[#TLS+5]]: lin
778 // CHECK-DAG: [[#TLS+6]]: step_sz
779 // CHECK-DAG: [[#TLS+7]]: [B1.[[#TLS+6]]] (ImplicitCastExpr, LValueToRValue, int)
780 // CHECK-DAG: [[#TLS+8]]: [B3.[[#TLSB+2]]]
781 // CHECK-DAG: [[#TLS+9]]: [B3.[[#TLSB]]]
782 // CHECK-DAG: [[#TLS+10]]: #pragma omp taskloop simd if(cond) firstprivate(fp) reduction(+: rd) linear(lin: step(step_sz))
783 // CHECK-DAG: for (int i = 0;
784 // CHECK-DAG: [B3.[[#TLSB+3]]];
785 #pragma omp taskloop simd if(cond) firstprivate(fp) reduction(+:rd) linear(lin: step_sz)
786 for (int i
= 0; i
< 10; ++i
)
790 // CHECK-LABEL: void maskedtaskloopsimd(int argc)
791 void maskedtaskloopsimd(int argc
) {
792 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
794 // CHECK-DAG: [[#MTLSB:]]: x
795 // CHECK-DAG: [[#MTLSB+1]]: [B3.[[#MTLSB]]] (ImplicitCastExpr, LValueToRValue, int)
796 // CHECK-DAG: [[#MTLSB+2]]: argc
797 // CHECK-DAG: [[#MTLSB+3]]: [B3.[[#MTLSB+2]]] = [B3.[[#MTLSB+1]]]
799 // CHECK-DAG: [[#MTLS:]]: cond
800 // CHECK-DAG: [[#MTLS+1]]: [B1.[[#MTLS]]] (ImplicitCastExpr, LValueToRValue, int)
801 // CHECK-DAG: [[#MTLS+2]]: [B1.[[#MTLS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
802 // CHECK-DAG: [[#MTLS+3]]: fp
803 // CHECK-DAG: [[#MTLS+4]]: rd
804 // CHECK-DAG: [[#MTLS+5]]: lin
805 // CHECK-DAG: [[#MTLS+6]]: step_sz
806 // CHECK-DAG: [[#MTLS+7]]: [B1.[[#MTLS+6]]] (ImplicitCastExpr, LValueToRValue, int)
807 // CHECK-DAG: [[#MTLS+8]]: [B3.[[#MTLSB+2]]]
808 // CHECK-DAG: [[#MTLS+9]]: [B3.[[#MTLSB]]]
809 // CHECK-DAG: [[#MTLS+10]]: #pragma omp masked taskloop simd if(cond) firstprivate(fp) reduction(+: rd) linear(lin: step(step_sz))
810 // CHECK-DAG: for (int i = 0;
811 // CHECK-DAG: [B3.[[#MTLSB+3]]];
812 #pragma omp masked taskloop simd if(cond) firstprivate(fp) reduction(+:rd) linear(lin: step_sz)
813 for (int i
= 0; i
< 10; ++i
)
817 // CHECK-LABEL: void tdpf(int argc)
818 void tdpf(int argc
) {
819 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
821 // CHECK-DAG: [[#TDPF:]]: [B1.{{.+}}]
822 // CHECK-DAG: [[#TDPF+1]]: [B1.[[#TDPF+6]]] (ImplicitCastExpr, LValueToRValue, int)
823 // CHECK-DAG: [[#TDPF+2]]: [B1.[[#TDPF+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
824 // CHECK-DAG: [[#TDPF+3]]: [B1.[[#TDPF+7]]]
825 // CHECK-DAG: [[#TDPF+4]]: [B1.[[#TDPF+8]]]
826 // CHECK-DAG: [[#TDPF+5]]: #pragma omp teams distribute parallel for if(cond) firstprivate(fp) reduction(+: rd)
827 // CHECK-DAG: for (int i = 0;
828 // CHECK-DAG: [B3.[[#TDPFB:]]];
829 // CHECK-DAG: [[#TDPF+6]]: cond
830 // CHECK-DAG: [[#TDPF+7]]: fp
831 // CHECK-DAG: [[#TDPF+8]]: rd
832 // CHECK-DAG: [[#TDPF+9]]: argc
833 // CHECK-DAG: [[#TDPF+10]]: x
834 // CHECK-DAG: [[#TDPF+11]]: #pragma omp target
836 // CHECK-DAG: [[#TDPFB-3]]: x
837 // CHECK-DAG: [[#TDPFB-2]]: [B3.[[#TDPFB-3]]] (ImplicitCastExpr, LValueToRValue, int)
838 // CHECK-DAG: [[#TDPFB-1]]: argc
839 // CHECK-DAG: [[#TDPFB]]: [B3.[[#TDPFB-1]]] = [B3.[[#TDPFB-2]]]
841 #pragma omp teams distribute parallel for if(cond) firstprivate(fp) reduction(+:rd)
842 for (int i
= 0; i
< 10; ++i
)
846 // CHECK-LABEL: void tdpfs(int argc)
847 void tdpfs(int argc
) {
848 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
850 // CHECK-DAG: [[#TDPFS:]]: [B1.{{.+}}]
851 // CHECK-DAG: [[#TDPFS+1]]: [B1.[[#TDPFS+6]]] (ImplicitCastExpr, LValueToRValue, int)
852 // CHECK-DAG: [[#TDPFS+2]]: [B1.[[#TDPFS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
853 // CHECK-DAG: [[#TDPFS+3]]: [B1.[[#TDPFS+7]]]
854 // CHECK-DAG: [[#TDPFS+4]]: [B1.[[#TDPFS+8]]]
855 // CHECK-DAG: [[#TDPFS+5]]: #pragma omp teams distribute parallel for simd if(cond) firstprivate(fp) reduction(+: rd)
856 // CHECK-DAG: for (int i = 0;
857 // CHECK-DAG: [B3.[[#TDPFSB:]]];
858 // CHECK-DAG: [[#TDPFS+6]]: cond
859 // CHECK-DAG: [[#TDPFS+7]]: fp
860 // CHECK-DAG: [[#TDPFS+8]]: rd
861 // CHECK-DAG: [[#TDPFS+9]]: argc
862 // CHECK-DAG: [[#TDPFS+10]]: x
863 // CHECK-DAG: [[#TDPFS+11]]: #pragma omp target
865 // CHECK-DAG: [[#TDPFSB-3]]: x
866 // CHECK-DAG: [[#TDPFSB-2]]: [B3.[[#TDPFSB-3]]] (ImplicitCastExpr, LValueToRValue, int)
867 // CHECK-DAG: [[#TDPFSB-1]]: argc
868 // CHECK-DAG: [[#TDPFSB]]: [B3.[[#TDPFSB-1]]] = [B3.[[#TDPFSB-2]]]
870 #pragma omp teams distribute parallel for simd if(cond) firstprivate(fp) reduction(+:rd)
871 for (int i
= 0; i
< 10; ++i
)
875 // CHECK-LABEL: void tds(int argc)
877 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
879 // CHECK-DAG: [[#TDS:]]: #pragma omp teams distribute simd firstprivate(fp) reduction(+: rd)
880 // CHECK-DAG: [[#TDS-2]]: [B1.[[#TDS+1]]]
881 // CHECK-DAG: [[#TDS-1]]: [B1.[[#TDS+2]]]
882 // CHECK-DAG: for (int i = 0;
883 // CHECK-DAG: [B3.[[#TDSB:]]];
884 // CHECK-DAG: [[#TDS+1]]: fp
885 // CHECK-DAG: [[#TDS+2]]: rd
886 // CHECK-DAG: [[#TDS+3]]: argc
887 // CHECK-DAG: [[#TDS+4]]: x
888 // CHECK-DAG: [[#TDS+5]]: #pragma omp target
890 // CHECK-DAG: [[#TDSB-3]]: x
891 // CHECK-DAG: [[#TDSB-2]]: [B3.[[#TDSB-3]]] (ImplicitCastExpr, LValueToRValue, int)
892 // CHECK-DAG: [[#TDSB-1]]: argc
893 // CHECK-DAG: [[#TDSB]]: [B3.[[#TDSB-1]]] = [B3.[[#TDSB-2]]]
895 #pragma omp teams distribute simd firstprivate(fp) reduction(+:rd)
896 for (int i
= 0; i
< 10; ++i
)
900 // CHECK-LABEL: void teamsloop(int argc)
901 void teamsloop(int argc
) {
902 int x
, cond
, fp
, rd
, lin
, step_sz
, map
;
904 // CHECK-DAG: [[#TDS:]]: #pragma omp teams loop firstprivate(fp) reduction(+: rd)
905 // CHECK-DAG: [[#TDS-2]]: [B1.[[#TDS+1]]]
906 // CHECK-DAG: [[#TDS-1]]: [B1.[[#TDS+2]]]
907 // CHECK-DAG: for (int i = 0;
908 // CHECK-DAG: [B3.[[#TDSB:]]];
909 // CHECK-DAG: [[#TDS+1]]: fp
910 // CHECK-DAG: [[#TDS+2]]: rd
911 // CHECK-DAG: [[#TDS+3]]: argc
912 // CHECK-DAG: [[#TDS+4]]: x
913 // CHECK-DAG: [[#TDS+5]]: #pragma omp target
915 // CHECK-DAG: [[#TDSB-3]]: x
916 // CHECK-DAG: [[#TDSB-2]]: [B3.[[#TDSB-3]]] (ImplicitCastExpr, LValueToRValue, int)
917 // CHECK-DAG: [[#TDSB-1]]: argc
918 // CHECK-DAG: [[#TDSB]]: [B3.[[#TDSB-1]]] = [B3.[[#TDSB-2]]]
920 #pragma omp teams loop firstprivate(fp) reduction(+:rd)
921 for (int i
= 0; i
< 10; ++i
)
925 // CHECK-LABEL: void targetteamsloop(int argc)
926 void targetteamsloop(int argc
) {
927 int x
, cond
, fp
, rd
, map
;
929 // CHECK-DAG: [[#TTDB:]]: x
930 // CHECK-DAG: [[#TTDB+1]]: [B3.[[#TTDB]]] (ImplicitCastExpr, LValueToRValue, int)
931 // CHECK-DAG: [[#TTDB+2]]: argc
932 // CHECK-DAG: [[#TTDB+3]]: [B3.[[#TTDB+2]]] = [B3.[[#TTDB+1]]]
934 // CHECK-DAG: [[#TTD:]]: cond
935 // CHECK-DAG: [[#TTD+1]]: [B1.[[#TTD]]] (ImplicitCastExpr, LValueToRValue, int)
936 // CHECK-DAG: [[#TTD+2]]: [B1.[[#TTD+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
937 // CHECK-DAG: [[#TTD+3]]: fp
938 // CHECK-DAG: [[#TTD+4]]: rd
939 // CHECK-DAG: [[#TTD+5]]: [B3.[[#TTDB+2]]]
940 // CHECK-DAG: [[#TTD+6]]: [B3.[[#TTDB]]]
941 // CHECK-DAG: [[#TTD+7]]: #pragma omp target teams loop if(cond) firstprivate(fp) reduction(+: rd) map(alloc: map)
942 // CHECK-DAG: for (int i = 0;
943 // CHECK-DAG: [B3.[[#TTDB+3]]];
944 #pragma omp target teams loop if(cond) firstprivate(fp) reduction(+:rd) map(alloc:map)
945 for (int i
= 0; i
< 10; ++i
)
949 // CHECK-LABEL: void parallelloop(int argc)
950 void parallelloop(int argc
) {
953 // CHECK-DAG: [[#PFB:]]: x
954 // CHECK-DAG: [[#PFB+1]]: [B3.[[#PFB]]] (ImplicitCastExpr, LValueToRValue, int)
955 // CHECK-DAG: [[#PFB+2]]: argc
956 // CHECK-DAG: [[#PFB+3]]: [B3.[[#PFB+2]]] = [B3.[[#PFB+1]]]
958 // CHECK-DAG: [[#PF:]]: cond
959 // CHECK-DAG: [[#PF+1]]: [B1.[[#PF]]] (ImplicitCastExpr, LValueToRValue, int)
960 // CHECK-DAG: [[#PF+2]]: [B1.[[#PF+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
961 // CHECK-DAG: [[#PF+3]]: fp
962 // CHECK-DAG: [[#PF+4]]: rd
963 // CHECK-DAG: [[#PF+5]]: #pragma omp parallel loop if(cond) firstprivate(fp) reduction(&: rd)
964 // CHECK-DAG: for (int i = 0;
965 // CHECK-DAG: [B3.[[#PFB+3]]];
966 #pragma omp parallel loop if(cond) firstprivate(fp) reduction(&:rd)
967 for (int i
= 0; i
< 10; ++i
)
971 // CHECK-LABEL: void targetparallelloop(int argc)
972 void targetparallelloop(int argc
) {
973 int x
, cond
, fp
, rd
, map
;
975 // CHECK-DAG: [[#TTDB:]]: x
976 // CHECK-DAG: [[#TTDB+1]]: [B3.[[#TTDB]]] (ImplicitCastExpr, LValueToRValue, int)
977 // CHECK-DAG: [[#TTDB+2]]: argc
978 // CHECK-DAG: [[#TTDB+3]]: [B3.[[#TTDB+2]]] = [B3.[[#TTDB+1]]]
980 // CHECK-DAG: [[#TTD:]]: cond
981 // CHECK-DAG: [[#TTD+1]]: [B1.[[#TTD]]] (ImplicitCastExpr, LValueToRValue, int)
982 // CHECK-DAG: [[#TTD+2]]: [B1.[[#TTD+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
983 // CHECK-DAG: [[#TTD+3]]: fp
984 // CHECK-DAG: [[#TTD+4]]: rd
985 // CHECK-DAG: [[#TTD+5]]: [B3.[[#TTDB+2]]]
986 // CHECK-DAG: [[#TTD+6]]: [B3.[[#TTDB]]]
987 // CHECK-DAG: [[#TTD+7]]: #pragma omp target parallel loop if(cond) firstprivate(fp) reduction(+: rd) map(alloc: map)
988 // CHECK-DAG: for (int i = 0;
989 // CHECK-DAG: [B3.[[#TTDB+3]]];
990 #pragma omp target parallel loop if(cond) firstprivate(fp) reduction(+:rd) map(alloc:map)
991 for (int i
= 0; i
< 10; ++i
)
995 // CHECK-LABEL: void parallelmasked(int argc)
996 void parallelmasked(int argc
) {
1000 // CHECK-NEXT: 2: int x = 0;
1001 // CHECK-NEXT: [[#MASKED:]]: x
1002 // CHECK-NEXT: [[#MASKED+1]]: [B1.[[#MASKED]]] (ImplicitCastExpr, LValueToRValue, int)
1003 // CHECK-NEXT: [[#MASKED+2]]: argc
1004 // CHECK-NEXT: [[#MASKED+3]]: [B1.[[#MASKED+2]]] = [B1.[[#MASKED+1]]]
1005 // CHECK-NEXT: [[#MASKED+4]]: #pragma omp parallel masked
1006 #pragma omp parallel masked