c++: prvalue of array type [PR111286]
[official-gcc.git] / gcc / testsuite / c-c++-common / gomp / Wparentheses-4.c
blobd44cdcd5756275367b50abe930326a2d8df4d427
1 /* PR c/70436 */
2 /* { dg-additional-options "-Wparentheses -fno-openmp" } */
4 int a, b, c;
5 void bar (void);
6 void baz (void);
7 void f1 (void);
8 #pragma omp declare target to (bar, baz, f1, a, b, c)
10 void
11 f1 (void)
13 int i, j;
15 if (a) /* { dg-warning "ambiguous" } */
16 #pragma omp distribute
17 for (i = 0; i < 10; i++)
18 if (b)
19 bar ();
20 else
21 baz ();
23 if (a) /* { dg-warning "ambiguous" } */
24 for (i = 0; i < 10; i++)
25 #pragma omp distribute simd
26 for (j = 0; j < 10; j++)
27 if (b)
28 bar ();
29 else
30 baz ();
32 if (a)
33 #pragma omp distribute parallel for
34 for (i = 0; i < 10; i++)
35 if (b) /* { dg-warning "ambiguous" } */
36 #pragma omp parallel for
37 for (j = 0; j < 10; j++)
38 if (c)
39 bar ();
40 else
41 baz ();
43 if (a) /* { dg-warning "ambiguous" } */
44 #pragma omp distribute parallel for simd collapse(2)
45 for (i = 0; i < 10; i++)
46 for (j = 0; j < 10; j++)
47 if (b)
48 bar ();
49 else
50 baz ();
52 if (a)
53 #pragma omp distribute
54 for (i = 0; i < 10; i++)
56 if (b)
57 bar ();
58 else
59 baz ();
62 if (a)
64 #pragma omp distribute simd
65 for (i = 0; i < 10; ++i)
66 if (b)
67 bar ();
69 else baz ();
71 if (a)
72 #pragma omp distribute parallel for collapse(2)
73 for (i = 0; i < 10; i++)
75 for (j = 0; j < 10; j++)
76 if (b)
77 bar ();
78 else
79 baz ();
82 if (a)
83 for (i = 0; i < 10; i++)
84 #pragma omp distribute parallel for simd
85 for (j = 0; j < 10; j++)
87 if (b)
88 bar ();
90 else
91 baz ();
94 void
95 f2 (void)
97 int i, j;
99 if (a) /* { dg-warning "ambiguous" } */
100 #pragma omp target teams distribute
101 for (i = 0; i < 10; i++)
102 if (b)
103 bar ();
104 else
105 baz ();
107 if (a) /* { dg-warning "ambiguous" } */
108 for (i = 0; i < 10; i++)
109 #pragma omp target teams distribute simd
110 for (j = 0; j < 10; j++)
111 if (b)
112 bar ();
113 else
114 baz ();
116 if (a)
117 #pragma omp target teams distribute parallel for
118 for (i = 0; i < 10; i++)
119 if (b) /* { dg-warning "ambiguous" } */
120 #pragma omp parallel for
121 for (j = 0; j < 10; j++)
122 if (c)
123 bar ();
124 else
125 baz ();
127 if (a) /* { dg-warning "ambiguous" } */
128 #pragma omp target teams distribute parallel for simd collapse(2)
129 for (i = 0; i < 10; i++)
130 for (j = 0; j < 10; j++)
131 if (b)
132 bar ();
133 else
134 baz ();
136 if (a) /* { dg-warning "ambiguous" } */
137 #pragma omp target teams
138 if (b)
139 bar ();
140 else
141 baz ();
143 if (a) /* { dg-warning "ambiguous" } */
144 #pragma omp target
145 #pragma omp parallel
146 if (b)
147 bar ();
148 else
149 baz ();
151 if (a) /* { dg-warning "ambiguous" } */
152 #pragma omp target
153 if (b)
154 bar ();
155 else
156 baz ();
158 if (a) /* { dg-warning "ambiguous" } */
159 #pragma omp target parallel
160 if (b)
161 bar ();
162 else
163 baz ();
165 if (a) /* { dg-warning "ambiguous" } */
166 #pragma omp target simd
167 for (i = 0; i < 10; i++)
168 if (b)
169 bar ();
170 else
171 baz ();
173 if (a) /* { dg-warning "ambiguous" } */
174 #pragma omp target simd collapse(2)
175 for (i = 0; i < 10; i++)
176 for (j = 0; j < 10; j++)
177 if (b)
178 bar ();
179 else
180 baz ();
182 if (a)
183 #pragma omp target teams distribute
184 for (i = 0; i < 10; i++)
186 if (b)
187 bar ();
188 else
189 baz ();
192 if (a)
194 #pragma omp target teams distribute simd
195 for (i = 0; i < 10; ++i)
196 if (b)
197 bar ();
199 else baz ();
201 if (a)
202 #pragma omp target teams distribute parallel for collapse(2)
203 for (i = 0; i < 10; i++)
205 for (j = 0; j < 10; j++)
206 if (b)
207 bar ();
208 else
209 baz ();
212 if (a)
213 for (i = 0; i < 10; i++)
214 #pragma omp target teams distribute parallel for simd
215 for (j = 0; j < 10; j++)
217 if (b)
218 bar ();
220 else
221 baz ();
223 if (a)
224 #pragma omp target teams
226 if (b)
227 bar ();
229 else
230 baz ();
232 if (a)
233 #pragma omp target
234 #pragma omp parallel
236 if (b)
237 bar ();
238 else
239 baz ();
242 if (a)
243 #pragma omp target
245 if (b)
246 bar ();
248 else
249 baz ();
251 if (a)
252 #pragma omp target parallel
254 if (b)
255 bar ();
257 else
258 baz ();
260 if (a)
261 #pragma omp target simd
262 for (i = 0; i < 10; i++)
264 if (b)
265 bar ();
266 else
267 baz ();
270 if (a)
271 #pragma omp target simd
272 for (i = 0; i < 10; i++)
274 if (b)
275 bar ();
277 else
278 baz ();
280 if (a)
281 #pragma omp target simd collapse(2)
282 for (i = 0; i < 10; i++)
284 for (j = 0; j < 10; j++)
285 if (b)
286 bar ();
287 else
288 baz ();
291 if (a)
292 #pragma omp target simd collapse(2)
293 for (i = 0; i < 10; i++)
295 for (j = 0; j < 10; j++)
296 if (b)
297 bar ();
300 else
301 baz ();
304 void
305 f3 (void)
307 int i, j;
309 if (a) /* { dg-warning "ambiguous" } */
310 #pragma omp target
311 #pragma omp teams distribute
312 for (i = 0; i < 10; i++)
313 if (b)
314 bar ();
315 else
316 baz ();
318 if (a) /* { dg-warning "ambiguous" } */
319 for (i = 0; i < 10; i++)
320 #pragma omp target
321 #pragma omp teams distribute simd
322 for (j = 0; j < 10; j++)
323 if (b)
324 bar ();
325 else
326 baz ();
328 if (a)
329 #pragma omp target
330 #pragma omp teams distribute parallel for
331 for (i = 0; i < 10; i++)
332 if (b) /* { dg-warning "ambiguous" } */
333 #pragma omp parallel for
334 for (j = 0; j < 10; j++)
335 if (c)
336 bar ();
337 else
338 baz ();
340 if (a) /* { dg-warning "ambiguous" } */
341 #pragma omp target
342 #pragma omp teams distribute parallel for simd collapse(2)
343 for (i = 0; i < 10; i++)
344 for (j = 0; j < 10; j++)
345 if (b)
346 bar ();
347 else
348 baz ();
350 if (a) /* { dg-warning "ambiguous" } */
351 #pragma omp target
352 #pragma omp teams
353 if (b)
354 bar ();
355 else
356 baz ();
358 if (a) /* { dg-warning "ambiguous" } */
359 #pragma omp target
360 #pragma omp teams
361 #pragma omp parallel
362 if (b)
363 bar ();
364 else
365 baz ();
367 if (a)
368 #pragma omp target
369 #pragma omp teams distribute
370 for (i = 0; i < 10; i++)
372 if (b)
373 bar ();
374 else
375 baz ();
378 if (a)
380 #pragma omp target
381 #pragma omp teams distribute simd
382 for (i = 0; i < 10; ++i)
383 if (b)
384 bar ();
386 else baz ();
388 if (a)
389 #pragma omp target
390 #pragma omp teams distribute parallel for collapse(2)
391 for (i = 0; i < 10; i++)
393 for (j = 0; j < 10; j++)
394 if (b)
395 bar ();
396 else
397 baz ();
400 if (a)
401 for (i = 0; i < 10; i++)
402 #pragma omp target
403 #pragma omp teams distribute parallel for simd
404 for (j = 0; j < 10; j++)
406 if (b)
407 bar ();
409 else
410 baz ();
412 if (a)
413 #pragma omp target
414 #pragma omp teams
416 if (b)
417 bar ();
419 else
420 baz ();
422 if (a)
423 #pragma omp target
424 #pragma omp teams
425 #pragma omp parallel
427 if (b)
428 bar ();
429 else
430 baz ();
434 void
435 f4 (void)
437 if (a) /* { dg-warning "ambiguous" } */
438 #pragma omp target data map (tofrom: b)
439 if (b)
440 bar ();
441 else
442 baz ();
444 if (a)
445 #pragma omp target data map (tofrom: b)
447 if (b)
448 bar ();
449 else
450 baz ();