Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / ordered_messages.cpp
blobfb79b07208d10350bf65be1a0e77aa34872bf5c3
1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
2 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++98 -o - %s -Wuninitialized
3 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
4 // RUN: %clang_cc1 -verify=expected,omp52 -fopenmp -fopenmp-version=52 -ferror-limit 100 -o - %s -Wuninitialized
6 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
7 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++98 -o - %s -Wuninitialized
8 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
10 void xxx(int argc) {
11 int x; // expected-note {{initialize the variable 'x' to silence this warning}}
12 #pragma omp for ordered
13 for (int i = 0; i < 10; ++i) {
14 #pragma omp ordered
15 argc = x; // expected-warning {{variable 'x' is uninitialized when used here}}
19 int foo();
20 #if __cplusplus >= 201103L
21 // expected-note@-2 {{declared here}}
22 #endif
24 template <class T>
25 T foo() {
26 T k;
27 #pragma omp for ordered
28 for (int i = 0; i < 10; ++i) {
29 L1:
30 foo();
31 #pragma omp ordered
33 foo();
34 goto L1; // expected-error {{use of undeclared label 'L1'}}
37 #pragma omp for ordered
38 for (int i = 0; i < 10; ++i) {
39 foo();
40 goto L2; // expected-error {{use of undeclared label 'L2'}}
41 #pragma omp ordered
43 L2:
44 foo();
47 #pragma omp for ordered
48 for (int i = 0; i < 10; ++i) {
49 #pragma omp ordered threads threads // expected-error {{directive '#pragma omp ordered' cannot contain more than one 'threads' clause}}
51 foo();
54 #pragma omp for ordered(1) // expected-note {{'ordered' clause with specified parameter}}
55 for (int i = 0; i < 10; ++i) {
56 #pragma omp ordered // expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}}
58 foo();
61 #pragma omp for ordered(1) // expected-note {{'ordered' clause with specified parameter}}
62 for (int i = 0; i < 10; ++i) {
63 #pragma omp ordered threads // expected-error {{'ordered' directive with 'threads' clause cannot be closely nested inside ordered region with specified parameter}}
65 foo();
68 #pragma omp for ordered
69 for (int i = 0; i < 10; ++i) {
70 #pragma omp ordered // expected-note {{previous 'ordered' directive used here}}
72 foo();
74 #pragma omp ordered // expected-error {{exactly one 'ordered' directive must appear in the loop body of an enclosing directive}}
76 foo();
79 #pragma omp ordered simd simd // expected-error {{directive '#pragma omp ordered' cannot contain more than one 'simd' clause}}
81 foo();
83 #pragma omp simd
84 for (int i = 0; i < 10; ++i) {
85 #pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside a simd region}}
87 foo();
90 #pragma omp simd
91 for (int i = 0; i < 10; ++i) {
92 #pragma omp ordered threads // expected-error {{OpenMP constructs may not be nested inside a simd region}}
94 foo();
97 #pragma omp simd
98 for (int i = 0; i < 10; ++i) {
99 #pragma omp ordered simd // expected-note {{previous 'ordered' directive used here}}
101 foo();
103 #pragma omp ordered simd // expected-error {{exactly one 'ordered' directive must appear in the loop body of an enclosing directive}}
105 foo();
108 #pragma omp for simd
109 for (int i = 0; i < 10; ++i) {
110 #pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside a simd region}}
112 foo();
115 #pragma omp for simd
116 for (int i = 0; i < 10; ++i) {
117 #pragma omp ordered threads // expected-error {{OpenMP constructs may not be nested inside a simd region}}
119 foo();
122 #pragma omp parallel for simd
123 for (int i = 0; i < 10; ++i) {
124 #pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside a simd region}}
126 foo();
129 #pragma omp parallel for simd
130 for (int i = 0; i < 10; ++i) {
131 #pragma omp ordered threads // expected-error {{OpenMP constructs may not be nested inside a simd region}}
133 foo();
135 #if _OPENMP >= 202111
136 #pragma omp ordered doacross(source:omp_cur_iteration) // expected-error {{OpenMP constructs may not be nested inside a simd region}}
137 #else
138 #pragma omp ordered depend(source) // expected-error {{OpenMP constructs may not be nested inside a simd region}}
139 #endif
141 #pragma omp parallel for ordered
142 for (int i = 0; i < 10; ++i) {
143 #if _OPENMP >= 202111
144 #pragma omp ordered doacross(source:) // omp52-error {{'ordered' directive with 'doacross' clause cannot be closely nested inside ordered region without specified parameter}}
145 #pragma omp ordered doacross(sink : i) // omp52-error {{'ordered' directive with 'doacross' clause cannot be closely nested inside ordered region without specified parameter}}
146 #else
147 #pragma omp ordered depend(source) // expected-error {{'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter}}
148 #pragma omp ordered depend(sink : i) // expected-error {{'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter}}
149 #endif
151 #pragma omp parallel for ordered(2) // expected-note 3 {{'ordered' clause with specified parameter}}
152 for (int i = 0; i < 10; ++i) {
153 for (int j = 0; j < 10; ++j) {
154 #if _OPENMP >= 202111
155 #pragma omp ordered doacross // omp52-error {{expected '(' after 'doacross'}} omp52-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}}
156 #pragma omp ordered doacross( // omp52-error {{expected ')'}} omp52-error {{expected 'source' or 'sink' in OpenMP clause 'doacross'}} omp52-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} omp52-warning {{missing ':' or ')' after dependence-type - ignoring}} omp52-note {{to match this '('}}
157 #pragma omp ordered doacross(source // omp52-warning {{missing ':' or ')' after dependence-type - ignoring}} omp52-error {{expected ')'}} omp52-note {{to match this '('}}
158 #pragma omp ordered doacross(sink // omp52-error {{expected expression}} omp52-warning {{missing ':' or ')' after dependence-type - ignoring}} omp52-error {{expected ')'}} omp52-note {{to match this '('}} omp52-error {{expected 'i' loop iteration variable}}
159 #pragma omp ordered doacross(sink : // omp52-error {{expected ')'}} omp52-note {{to match this '('}} omp52-error {{expected expression}} omp52-error {{expected 'i' loop iteration variable}}
160 #pragma omp ordered doacross(sink : i // omp52-error {{expected ')'}} omp52-note {{to match this '('}} omp52-error {{expected 'j' loop iteration variable}}
161 #pragma omp ordered doacross(sink : i) // omp52-error {{expected 'j' loop iteration variable}}
162 #pragma omp ordered doacross(sink:omp_cur_iteration + 1) // omp52-error {{'doacross sink:' must be with 'omp_cur_iteration - 1'}}
163 #pragma omp ordered doacross(sink:omp_cur_iteration - 2) // omp52-error {{'doacross sink:' must be with 'omp_cur_iteration - 1'}}
164 #pragma omp ordered doacross(sink:omp_cur_iteration) // omp52-error {{'doacross sink:' must be with 'omp_cur_iteration - 1'}}
165 #pragma omp ordered doacross(source:omp_cur_iteration - 1) // omp52-error {{'doacross source:' must be with 'omp_cur_iteration'}}
166 #pragma omp ordered doacross(source:)
167 if (i == j)
168 #pragma omp ordered doacross(source:) // omp52-error {{'#pragma omp ordered' with 'doacross' clause cannot be an immediate substatement}}
170 if (i == j)
171 #pragma omp ordered doacross(sink : i, j) // omp52-error {{'#pragma omp ordered' with 'doacross' clause cannot be an immediate substatement}}
173 #pragma omp ordered doacross(source:) threads // omp52-error {{'doacross' clauses cannot be mixed with 'threads' clause}}
174 #pragma omp ordered simd doacross(source:) // omp52-error {{'doacross' clauses cannot be mixed with 'simd' clause}}
175 #pragma omp ordered doacross(source:) doacross(source:) // omp52-error {{directive '#pragma omp ordered' cannot contain more than one 'doacross' clause with 'source' dependence}}
176 #pragma omp ordered doacross(in : i) // omp52-error {{expected 'source' or 'sink' in OpenMP clause 'doacross'}} omp52-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}}
177 #pragma omp ordered doacross(sink : i, j)
178 #pragma omp ordered doacross(sink : j, i) // omp52-error {{expected 'i' loop iteration variable}} omp52-error {{expected 'j' loop iteration variable}}
179 #pragma omp ordered doacross(sink : i, j, k) // omp52-error {{unexpected expression: number of expressions is larger than the number of associated loops}}
180 #pragma omp ordered doacross(sink : i+foo(), j/4) // omp52-error {{integral constant expression}} omp52-error {{expected '+' or '-' operation}}
181 #if __cplusplus >= 201103L
182 // omp52-note@-2 {{non-constexpr function 'foo' cannot be used in a constant expression}}
183 #endif
184 #pragma omp ordered doacross(sink : i*0, j-4)// omp52-error {{expected '+' or '-' operation}}
185 #pragma omp ordered doacross(sink : i-0, j+sizeof(T)) doacross(sink : i-0, j+sizeof(T))
186 #pragma omp ordered doacross(sink : i-0, j+sizeof(T)) doacross(source:) // omp52-error {{'doacross(source)' clause cannot be mixed with 'doacross(sink:vec)' clauses}}
187 #pragma omp ordered doacross(source:) doacross(sink : i-0, j+sizeof(T)) // omp52-error {{'doacross(sink:vec)' clauses cannot be mixed with 'doacross(source)' clause}}
188 #else
189 #pragma omp ordered depend // expected-error {{expected '(' after 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}}
190 #pragma omp ordered depend( // expected-error {{expected ')'}} expected-error {{expected 'source' or 'sink' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} expected-warning {{missing ':' or ')' after dependency type - ignoring}} expected-note {{to match this '('}}
191 #pragma omp ordered depend(source // expected-error {{expected ')'}} expected-note {{to match this '('}}
192 #pragma omp ordered depend(sink // expected-error {{expected expression}} expected-warning {{missing ':' or ')' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'i' loop iteration variable}}
193 #pragma omp ordered depend(sink : // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}} expected-error {{expected 'i' loop iteration variable}}
194 #pragma omp ordered depend(sink : i // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'j' loop iteration variable}}
195 #pragma omp ordered depend(sink : i) // expected-error {{expected 'j' loop iteration variable}}
196 #pragma omp ordered depend(source)
197 if (i == j)
198 #pragma omp ordered depend(source) // expected-error {{'#pragma omp ordered' with 'depend' clause cannot be an immediate substatement}}
200 if (i == j)
201 #pragma omp ordered depend(sink : i, j) // expected-error {{'#pragma omp ordered' with 'depend' clause cannot be an immediate substatement}}
203 #pragma omp ordered depend(source) threads // expected-error {{'depend' clauses cannot be mixed with 'threads' clause}}
204 #pragma omp ordered simd depend(source) // expected-error {{'depend' clauses cannot be mixed with 'simd' clause}}
205 #pragma omp ordered depend(source) depend(source) // expected-error {{directive '#pragma omp ordered' cannot contain more than one 'depend' clause with 'source' dependence}}
206 #pragma omp ordered depend(in : i) // expected-error {{expected 'source' or 'sink' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}}
207 #pragma omp ordered depend(sink : i, j)
208 #pragma omp ordered depend(sink : j, i) // expected-error {{expected 'i' loop iteration variable}} expected-error {{expected 'j' loop iteration variable}}
209 #pragma omp ordered depend(sink : i, j, k) // expected-error {{unexpected expression: number of expressions is larger than the number of associated loops}}
210 #pragma omp ordered depend(sink : i+foo(), j/4) // expected-error {{integral constant expression}} expected-error {{expected '+' or '-' operation}}
211 #if __cplusplus >= 201103L
212 // expected-note@-2 {{non-constexpr function 'foo' cannot be used in a constant expression}}
213 #endif
214 #pragma omp ordered depend(sink : i*0, j-4)// expected-error {{expected '+' or '-' operation}}
215 #pragma omp ordered depend(sink : i-0, j+sizeof(T)) depend(sink : i-0, j+sizeof(T))
216 #pragma omp ordered depend(sink : i-0, j+sizeof(T)) depend(source) // expected-error {{'depend(source)' clause cannot be mixed with 'depend(sink:vec)' clauses}}
217 #pragma omp ordered depend(source) depend(sink : i-0, j+sizeof(T)) // expected-error {{'depend(sink:vec)' clauses cannot be mixed with 'depend(source)' clause}}
218 #endif
221 #if _OPENMP >= 202111
222 #else
223 #pragma omp ordered depend(source) // expected-error {{'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter}}
224 #pragma omp ordered depend(sink:k) // expected-error {{'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter}}
225 #endif
226 return T();
229 int foo() {
230 #if __cplusplus >= 201103L
231 // expected-note@-2 {{declared here}}
232 #endif
233 int k;
234 #pragma omp for ordered
235 for (int i = 0; i < 10; ++i) {
237 foo();
238 #pragma omp ordered
240 foo();
241 goto L1; // expected-error {{use of undeclared label 'L1'}}
244 #pragma omp for ordered
245 for (int i = 0; i < 10; ++i) {
246 foo();
247 goto L2; // expected-error {{use of undeclared label 'L2'}}
248 #pragma omp ordered
251 foo();
254 #pragma omp for ordered
255 for (int i = 0; i < 10; ++i) {
256 #pragma omp ordered threads threads // expected-error {{directive '#pragma omp ordered' cannot contain more than one 'threads' clause}}
258 foo();
261 #pragma omp for ordered(1) // expected-note {{'ordered' clause with specified parameter}}
262 for (int i = 0; i < 10; ++i) {
263 #pragma omp ordered // expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}}
265 foo();
268 #pragma omp for ordered(1) // expected-note {{'ordered' clause with specified parameter}}
269 for (int i = 0; i < 10; ++i) {
270 #pragma omp ordered threads // expected-error {{'ordered' directive with 'threads' clause cannot be closely nested inside ordered region with specified parameter}}
272 foo();
275 #pragma omp ordered simd simd // expected-error {{directive '#pragma omp ordered' cannot contain more than one 'simd' clause}}
277 foo();
279 #pragma omp simd
280 for (int i = 0; i < 10; ++i) {
281 #pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside a simd region}}
283 foo();
286 #pragma omp simd
287 for (int i = 0; i < 10; ++i) {
288 #pragma omp ordered threads // expected-error {{OpenMP constructs may not be nested inside a simd region}}
290 foo();
293 #pragma omp for simd
294 for (int i = 0; i < 10; ++i) {
295 #pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside a simd region}}
297 foo();
300 #pragma omp for simd
301 for (int i = 0; i < 10; ++i) {
302 #pragma omp ordered threads // expected-error {{OpenMP constructs may not be nested inside a simd region}}
304 foo();
307 #pragma omp parallel for simd
308 for (int i = 0; i < 10; ++i) {
309 #pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside a simd region}}
311 foo();
314 #pragma omp parallel for simd
315 for (int i = 0; i < 10; ++i) {
316 #pragma omp ordered threads // expected-error {{OpenMP constructs may not be nested inside a simd region}}
318 foo();
320 #if _OPENMP >= 202111
321 #pragma omp ordered doacross(source:omp_cur_iteration) // expected-error {{OpenMP constructs may not be nested inside a simd region}}
322 #else
323 #pragma omp ordered depend(source) // expected-error {{OpenMP constructs may not be nested inside a simd region}}
324 #endif
326 #pragma omp parallel for ordered
327 for (int i = 0; i < 10; ++i) {
328 #if _OPENMP >= 202111
329 #else
330 #pragma omp ordered depend(source) // expected-error {{'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter}}
331 #pragma omp ordered depend(sink : i) // expected-error {{'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter}}
332 #endif
334 #pragma omp parallel for ordered(2) // expected-note 3 {{'ordered' clause with specified parameter}}
335 for (int i = 0; i < 10; ++i) {
336 for (int j = 0; j < 10; ++j) {
337 #if _OPENMP >= 202111
338 #pragma omp ordered doacross // omp52-error {{expected '(' after 'doacross'}} omp52-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}}
339 #pragma omp ordered doacross( // omp52-error {{expected ')'}} omp52-error {{expected 'source' or 'sink' in OpenMP clause 'doacross'}} omp52-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} omp52-warning {{missing ':' or ')' after dependence-type - ignoring}} omp52-note {{to match this '('}}
340 #pragma omp ordered doacross(source // omp52-warning {{missing ':' or ')' after dependence-type - ignoring}} omp52-error {{expected ')'}} omp52-note {{to match this '('}}
341 #pragma omp ordered doacross(sink // omp52-error {{expected expression}} omp52-warning {{missing ':' or ')' after dependence-type - ignoring}} omp52-error {{expected ')'}} omp52-note {{to match this '('}} omp52-error {{expected 'i' loop iteration variable}}
342 #pragma omp ordered doacross(sink : // omp52-error {{expected ')'}} omp52-note {{to match this '('}} omp52-error {{expected expression}} omp52-error {{expected 'i' loop iteration variable}}
343 #pragma omp ordered doacross(sink : i // omp52-error {{expected ')'}} omp52-note {{to match this '('}} omp52-error {{expected 'j' loop iteration variable}}
344 #pragma omp ordered doacross(sink : i) // omp52-error {{expected 'j' loop iteration variable}}
345 #pragma omp ordered doacross(source:)
346 if (i == j)
347 #pragma omp ordered doacross(source:) // omp52-error {{'#pragma omp ordered' with 'doacross' clause cannot be an immediate substatement}}
349 if (i == j)
350 #pragma omp ordered doacross(sink : i, j) // omp52-error {{'#pragma omp ordered' with 'doacross' clause cannot be an immediate substatement}}
352 #pragma omp ordered doacross(source:) threads // omp52-error {{'doacross' clauses cannot be mixed with 'threads' clause}}
353 #pragma omp ordered simd doacross(source:) // omp52-error {{'doacross' clauses cannot be mixed with 'simd' clause}}
354 #pragma omp ordered doacross(source:) doacross(source:) // omp52-error {{directive '#pragma omp ordered' cannot contain more than one 'doacross' clause with 'source' dependence}}
355 #pragma omp ordered doacross(in : i) // omp52-error {{expected 'source' or 'sink' in OpenMP clause 'doacross'}} omp52-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}}
356 #pragma omp ordered doacross(sink : i, j) allocate(i) // omp52-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp ordered'}}
357 #pragma omp ordered doacross(sink : j, i) // omp52-error {{expected 'i' loop iteration variable}} omp52-error {{expected 'j' loop iteration variable}}
358 #pragma omp ordered doacross(sink : i, j, k) // omp52-error {{unexpected expression: number of expressions is larger than the number of associated loops}}
359 #pragma omp ordered doacross(sink : i+foo(), j/4) // omp52-error {{integral constant expression}} omp52-error {{expected '+' or '-' operation}}
360 #if __cplusplus >= 201103L
361 // omp52-note@-2 {{non-constexpr function 'foo' cannot be used in a constant expression}}
362 #endif
363 #pragma omp ordered doacross(sink : i*0, j-4)// omp52-error {{expected '+' or '-' operation}}
364 #pragma omp ordered doacross(sink : i-0, j+sizeof(int)) doacross(sink : i-0, j+sizeof(int))
365 #pragma omp ordered doacross(sink : i-0, j+sizeof(int)) doacross(source:) // omp52-error {{'doacross(source)' clause cannot be mixed with 'doacross(sink:vec)' clauses}}
366 #pragma omp ordered doacross(source:) doacross(sink : i-0, j+sizeof(int)) // omp52-error {{'doacross(sink:vec)' clauses cannot be mixed with 'doacross(source)' clause}}
367 #else
368 #pragma omp ordered depend // expected-error {{expected '(' after 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}}
369 #pragma omp ordered depend( // expected-error {{expected ')'}} expected-error {{expected 'source' or 'sink' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} expected-warning {{missing ':' or ')' after dependency type - ignoring}} expected-note {{to match this '('}}
370 #pragma omp ordered depend(source // expected-error {{expected ')'}} expected-note {{to match this '('}}
371 #pragma omp ordered depend(sink // expected-error {{expected expression}} expected-warning {{missing ':' or ')' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'i' loop iteration variable}}
372 #pragma omp ordered depend(sink : // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}} expected-error {{expected 'i' loop iteration variable}}
373 #pragma omp ordered depend(sink : i // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'j' loop iteration variable}}
374 #pragma omp ordered depend(sink : i) // expected-error {{expected 'j' loop iteration variable}}
375 #pragma omp ordered depend(source)
376 if (i == j)
377 #pragma omp ordered depend(source) // expected-error {{'#pragma omp ordered' with 'depend' clause cannot be an immediate substatement}}
379 if (i == j)
380 #pragma omp ordered depend(sink : i, j) // expected-error {{'#pragma omp ordered' with 'depend' clause cannot be an immediate substatement}}
382 #pragma omp ordered depend(source) threads // expected-error {{'depend' clauses cannot be mixed with 'threads' clause}}
383 #pragma omp ordered simd depend(source) // expected-error {{'depend' clauses cannot be mixed with 'simd' clause}}
384 #pragma omp ordered depend(source) depend(source) // expected-error {{directive '#pragma omp ordered' cannot contain more than one 'depend' clause with 'source' dependence}}
385 #pragma omp ordered depend(in : i) // expected-error {{expected 'source' or 'sink' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}}
386 #pragma omp ordered depend(sink : i, j) allocate(i) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp ordered'}}
387 #pragma omp ordered depend(sink : j, i) // expected-error {{expected 'i' loop iteration variable}} expected-error {{expected 'j' loop iteration variable}}
388 #pragma omp ordered depend(sink : i, j, k) // expected-error {{unexpected expression: number of expressions is larger than the number of associated loops}}
389 #pragma omp ordered depend(sink : i+foo(), j/4) // expected-error {{integral constant expression}} expected-error {{expected '+' or '-' operation}}
390 #if __cplusplus >= 201103L
391 // expected-note@-2 {{non-constexpr function 'foo' cannot be used in a constant expression}}
392 #endif
393 #pragma omp ordered depend(sink : i*0, j-4)// expected-error {{expected '+' or '-' operation}}
394 #pragma omp ordered depend(sink : i-0, j+sizeof(int)) depend(sink : i-0, j+sizeof(int))
395 #pragma omp ordered depend(sink : i-0, j+sizeof(int)) depend(source) // expected-error {{'depend(source)' clause cannot be mixed with 'depend(sink:vec)' clauses}}
396 #pragma omp ordered depend(source) depend(sink : i-0, j+sizeof(int)) // expected-error {{'depend(sink:vec)' clauses cannot be mixed with 'depend(source)' clause}}
397 #endif
401 #pragma omp for ordered(2) // expected-note {{as specified in 'ordered' clause}}
402 for (int i = 0; i < 10; ++i) { // expected-error {{expected 2 for loops after '#pragma omp for', but found only 1}}
403 #if _OPENMP >= 202111
404 #pragma omp ordered doacross(sink : i)
405 #pragma omp ordered depend(source) // expected-warning {{'depend' clause for 'ordered' is deprecated; use 'doacross' instead}}
406 int j;
407 #pragma omp ordered doacross(sink : i, j) // omp52-error {{expected loop iteration variable}}
408 #else
409 #pragma omp ordered depend(sink : i)
410 int j;
411 #pragma omp ordered depend(sink : i, j) // expected-error {{expected loop iteration variable}}
412 #endif
413 foo();
416 return foo<int>(); // expected-note {{in instantiation of function template specialization 'foo<int>' requested here}}