Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / gcc.dg / gomp / nesting-1.c
blobed457ced44cef400f3d04a979d88d9e3403efd9b
1 /* { dg-do compile } */
2 /* { dg-options "-fopenmp" } */
4 void
5 f1 (void)
7 int i, j;
8 #pragma omp for
9 for (i = 0; i < 3; i++)
11 #pragma omp for /* { dg-error "may not be closely nested" } */
12 for (j = 0; j < 3; j++)
14 #pragma omp sections /* { dg-error "may not be closely nested" } */
17 #pragma omp section
20 #pragma omp single /* { dg-error "may not be closely nested" } */
22 #pragma omp master /* { dg-error "may not be closely nested" } */
24 #pragma omp masked /* { dg-error "may not be closely nested" } */
26 #pragma omp barrier /* { dg-error "may not be closely nested" } */
27 #pragma omp scope /* { dg-error "may not be closely nested" } */
30 #pragma omp sections
32 #pragma omp for /* { dg-error "may not be closely nested" } */
33 for (j = 0; j < 3; j++)
36 #pragma omp sections
38 #pragma omp sections /* { dg-error "may not be closely nested" } */
41 #pragma omp section
45 #pragma omp sections
47 #pragma omp single /* { dg-error "may not be closely nested" } */
50 #pragma omp sections
52 #pragma omp master /* { dg-error "may not be closely nested" } */
55 #pragma omp sections
57 #pragma omp masked /* { dg-error "may not be closely nested" } */
60 #pragma omp sections
62 #pragma omp scope /* { dg-error "may not be closely nested" } */
65 #pragma omp sections
67 #pragma omp section
70 #pragma omp sections
72 #pragma omp section
73 #pragma omp for /* { dg-error "may not be closely nested" } */
74 for (j = 0; j < 3; j++)
77 #pragma omp sections
79 #pragma omp section
80 #pragma omp sections /* { dg-error "may not be closely nested" } */
83 #pragma omp section
87 #pragma omp sections
89 #pragma omp section
90 #pragma omp single /* { dg-error "may not be closely nested" } */
93 #pragma omp sections
95 #pragma omp section
96 #pragma omp master /* { dg-error "may not be closely nested" } */
98 #pragma omp section
99 #pragma omp masked /* { dg-error "may not be closely nested" } */
102 #pragma omp sections
104 #pragma omp section
105 #pragma omp scope /* { dg-error "may not be closely nested" } */
108 #pragma omp single
110 #pragma omp for /* { dg-error "may not be closely nested" } */
111 for (j = 0; j < 3; j++)
113 #pragma omp sections /* { dg-error "may not be closely nested" } */
116 #pragma omp section
119 #pragma omp single /* { dg-error "may not be closely nested" } */
121 #pragma omp master /* { dg-error "may not be closely nested" } */
123 #pragma omp masked /* { dg-error "may not be closely nested" } */
125 #pragma omp barrier /* { dg-error "may not be closely nested" } */
126 #pragma omp scope /* { dg-error "may not be closely nested" } */
129 #pragma omp master
131 #pragma omp for /* { dg-error "may not be closely nested" } */
132 for (j = 0; j < 3; j++)
134 #pragma omp sections /* { dg-error "may not be closely nested" } */
137 #pragma omp section
140 #pragma omp single /* { dg-error "may not be closely nested" } */
142 #pragma omp master
144 #pragma omp barrier /* { dg-error "may not be closely nested" } */
145 #pragma omp scope /* { dg-error "may not be closely nested" } */
148 #pragma omp masked filter (1)
150 #pragma omp for /* { dg-error "may not be closely nested" } */
151 for (j = 0; j < 3; j++)
153 #pragma omp sections /* { dg-error "may not be closely nested" } */
156 #pragma omp section
159 #pragma omp single /* { dg-error "may not be closely nested" } */
161 #pragma omp master
163 #pragma omp barrier /* { dg-error "may not be closely nested" } */
164 #pragma omp scope /* { dg-error "may not be closely nested" } */
167 #pragma omp task
169 #pragma omp for /* { dg-error "may not be closely nested" } */
170 for (j = 0; j < 3; j++)
172 #pragma omp sections /* { dg-error "may not be closely nested" } */
175 #pragma omp section
178 #pragma omp single /* { dg-error "may not be closely nested" } */
180 #pragma omp master /* { dg-error "may not be closely nested" } */
182 #pragma omp masked /* { dg-error "may not be closely nested" } */
184 #pragma omp barrier /* { dg-error "may not be closely nested" } */
185 #pragma omp scope /* { dg-error "may not be closely nested" } */
188 #pragma omp parallel
190 #pragma omp for
191 for (j = 0; j < 3; j++)
193 #pragma omp sections
196 #pragma omp section
199 #pragma omp single
201 #pragma omp master
203 #pragma omp masked
205 #pragma omp barrier
206 #pragma omp scope
208 #pragma omp scope
210 #pragma omp scope
214 #pragma omp scope
216 #pragma omp for
217 for (j = 0; j < 3; j++)
219 #pragma omp sections
222 #pragma omp section
225 #pragma omp single
227 #pragma omp master
229 #pragma omp masked
231 #pragma omp barrier
232 #pragma omp scope
234 #pragma omp scope
236 #pragma omp scope
242 void
243 f2 (void)
245 int i, j;
246 #pragma omp ordered
248 #pragma omp for /* { dg-error "may not be closely nested" } */
249 for (j = 0; j < 3; j++)
251 #pragma omp sections /* { dg-error "may not be closely nested" } */
254 #pragma omp section
257 #pragma omp single /* { dg-error "may not be closely nested" } */
259 #pragma omp master
261 #pragma omp masked
263 #pragma omp barrier /* { dg-error "may not be closely nested" } */
264 #pragma omp scope /* { dg-error "may not be closely nested" } */
269 void
270 f3 (void)
272 #pragma omp critical
274 #pragma omp ordered /* { dg-error "may not be closely nested" } */
276 #pragma omp scope /* { dg-error "may not be closely nested" } */
281 void
282 f4 (void)
284 #pragma omp task
286 #pragma omp ordered /* { dg-error "may not be closely nested" } */
288 #pragma omp scope /* { dg-error "may not be closely nested" } */
293 void
294 f5 (void)
296 int i;
297 #pragma omp for
298 for (i = 0; i < 10; i++)
300 #pragma omp ordered /* { dg-error "must be closely nested" } */
303 #pragma omp for ordered
304 for (i = 0; i < 10; i++)
306 #pragma omp ordered
311 void
312 f6 (void)
314 #pragma omp critical (foo)
315 #pragma omp critical (bar)
317 #pragma omp critical
318 #pragma omp critical (baz)
322 void
323 f7 (void)
325 #pragma omp critical (foo2)
326 #pragma omp critical
328 #pragma omp critical (bar)
329 #pragma omp critical (bar) /* { dg-error "may not be nested" } */
331 #pragma omp critical
332 #pragma omp critical /* { dg-error "may not be nested" } */