1 // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
2 // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
3 // RUN: %clang_cc1 -fsyntax-only -fopenmp -verify=expected,omp51 %s -Wuninitialized
5 // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
6 // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
7 // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify=expected,omp51 %s -Wuninitialized
10 int x
; // expected-note {{initialize the variable 'x' to silence this warning}}
11 #pragma omp distribute parallel for simd
12 for (int i
= 0; i
< 10; ++i
)
13 argc
= x
; // expected-warning {{variable 'x' is uninitialized when used here}}
16 // expected-error@+1 {{unexpected OpenMP directive '#pragma omp distribute parallel for simd'}}
17 #pragma omp distribute parallel for simd
19 // expected-error@+1 {{unexpected OpenMP directive '#pragma omp distribute parallel for simd'}}
20 #pragma omp distribute parallel for simd foo
22 void test_no_clause(void) {
24 #pragma omp distribute parallel for simd
25 for (i
= 0; i
< 16; ++i
)
28 // expected-error@+2 {{statement after '#pragma omp distribute parallel for simd' must be a for loop}}
29 #pragma omp distribute parallel for simd
33 void test_branch_protected_scope(void) {
42 #pragma omp distribute parallel for simd
43 for (i
= 0; i
< 16; ++i
) {
45 goto L1
; // expected-error {{use of undeclared label 'L1'}}
47 return; // expected-error {{cannot return from OpenMP region}}
57 goto L2
; // expected-error {{use of undeclared label 'L2'}}
62 void test_invalid_clause(void) {
66 // expected-warning@+1 {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
67 #pragma omp distribute parallel for simd foo bar
68 for (i
= 0; i
< 16; ++i
)
72 void test_non_identifiers(void) {
77 // expected-warning@+1 {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
78 #pragma omp distribute parallel for simd;
79 for (i
= 0; i
< 16; ++i
)
83 // expected-warning@+1 {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
84 #pragma omp distribute parallel for simd firstprivate(x);
85 for (i
= 0; i
< 16; ++i
)
90 // expected-warning@+1 {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
91 #pragma omp distribute parallel for simd private(x);
92 for (i
= 0; i
< 16; ++i
)
97 // expected-warning@+1 {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
98 #pragma omp distribute parallel for simd, private(x);
99 for (i
= 0; i
< 16; ++i
)
103 extern int foo(void);
104 void test_safelen(void) {
108 // expected-error@+1 {{expected '('}}
109 #pragma omp distribute parallel for simd safelen
110 for (i
= 0; i
< 16; ++i
)
114 // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
115 #pragma omp distribute parallel for simd safelen(
116 for (i
= 0; i
< 16; ++i
)
120 // expected-error@+1 {{expected expression}}
121 #pragma omp distribute parallel for simd safelen()
122 for (i
= 0; i
< 16; ++i
)
126 // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
127 #pragma omp distribute parallel for simd safelen(,
128 for (i
= 0; i
< 16; ++i
)
132 // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
133 #pragma omp distribute parallel for simd safelen(, )
134 for (i
= 0; i
< 16; ++i
)
138 // expected-warning@+2 {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
139 // expected-error@+1 {{expected '('}}
140 #pragma omp distribute parallel for simd safelen 4)
141 for (i
= 0; i
< 16; ++i
)
145 // expected-error@+2 {{expected ')'}}
146 // expected-note@+1 {{to match this '('}}
147 #pragma omp distribute parallel for simd safelen(4
148 for (i
= 0; i
< 16; ++i
)
152 // expected-error@+2 {{expected ')'}}
153 // expected-note@+1 {{to match this '('}}
154 #pragma omp distribute parallel for simd safelen(4,
155 for (i
= 0; i
< 16; ++i
)
159 // expected-error@+2 {{expected ')'}}
160 // expected-note@+1 {{to match this '('}}
161 #pragma omp distribute parallel for simd safelen(4, )
162 for (i
= 0; i
< 16; ++i
)
166 #pragma omp distribute parallel for simd safelen(4)
167 for (i
= 0; i
< 16; ++i
)
171 // expected-error@+2 {{expected ')'}}
172 // expected-note@+1 {{to match this '('}}
173 #pragma omp distribute parallel for simd safelen(4 4)
174 for (i
= 0; i
< 16; ++i
)
178 // expected-error@+2 {{expected ')'}}
179 // expected-note@+1 {{to match this '('}}
180 #pragma omp distribute parallel for simd safelen(4, , 4)
181 for (i
= 0; i
< 16; ++i
)
185 #pragma omp distribute parallel for simd safelen(4)
186 for (i
= 0; i
< 16; ++i
)
190 // expected-error@+2 {{expected ')'}}
191 // expected-note@+1 {{to match this '('}}
192 #pragma omp distribute parallel for simd safelen(4, 8)
193 for (i
= 0; i
< 16; ++i
)
197 // expected-error@+1 {{integer constant expression}}
198 #pragma omp distribute parallel for simd safelen(2.5)
199 for (i
= 0; i
< 16; ++i
)
203 // expected-error@+1 {{integer constant expression}}
204 #pragma omp distribute parallel for simd safelen(foo())
205 for (i
= 0; i
< 16; ++i
)
209 // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}}
210 #pragma omp distribute parallel for simd safelen(-5)
211 for (i
= 0; i
< 16; ++i
)
215 // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}}
216 #pragma omp distribute parallel for simd safelen(0)
217 for (i
= 0; i
< 16; ++i
)
221 // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}}
222 #pragma omp distribute parallel for simd safelen(5 - 5)
223 for (i
= 0; i
< 16; ++i
)
227 void test_simdlen(void) {
231 // expected-error@+1 {{expected '('}}
232 #pragma omp distribute parallel for simd simdlen
233 for (i
= 0; i
< 16; ++i
)
237 // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
238 #pragma omp distribute parallel for simd simdlen(
239 for (i
= 0; i
< 16; ++i
)
243 // expected-error@+1 {{expected expression}}
244 #pragma omp distribute parallel for simd simdlen()
245 for (i
= 0; i
< 16; ++i
)
249 // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
250 #pragma omp distribute parallel for simd simdlen(,
251 for (i
= 0; i
< 16; ++i
)
255 // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
256 #pragma omp distribute parallel for simd simdlen(, )
257 for (i
= 0; i
< 16; ++i
)
261 // expected-warning@+2 {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
262 // expected-error@+1 {{expected '('}}
263 #pragma omp distribute parallel for simd simdlen 4)
264 for (i
= 0; i
< 16; ++i
)
268 // expected-error@+2 {{expected ')'}}
269 // expected-note@+1 {{to match this '('}}
270 #pragma omp distribute parallel for simd simdlen(4
271 for (i
= 0; i
< 16; ++i
)
275 // expected-error@+2 {{expected ')'}}
276 // expected-note@+1 {{to match this '('}}
277 #pragma omp distribute parallel for simd simdlen(4,
278 for (i
= 0; i
< 16; ++i
)
282 // expected-error@+2 {{expected ')'}}
283 // expected-note@+1 {{to match this '('}}
284 #pragma omp distribute parallel for simd simdlen(4, )
285 for (i
= 0; i
< 16; ++i
)
289 #pragma omp distribute parallel for simd simdlen(4)
290 for (i
= 0; i
< 16; ++i
)
294 // expected-error@+2 {{expected ')'}}
295 // expected-note@+1 {{to match this '('}}
296 #pragma omp distribute parallel for simd simdlen(4 4)
297 for (i
= 0; i
< 16; ++i
)
301 // expected-error@+2 {{expected ')'}}
302 // expected-note@+1 {{to match this '('}}
303 #pragma omp distribute parallel for simd simdlen(4, , 4)
304 for (i
= 0; i
< 16; ++i
)
308 #pragma omp distribute parallel for simd simdlen(4)
309 for (i
= 0; i
< 16; ++i
)
313 // expected-error@+2 {{expected ')'}}
314 // expected-note@+1 {{to match this '('}}
315 #pragma omp distribute parallel for simd simdlen(4, 8)
316 for (i
= 0; i
< 16; ++i
)
320 // expected-error@+1 {{integer constant expression}}
321 #pragma omp distribute parallel for simd simdlen(2.5)
322 for (i
= 0; i
< 16; ++i
)
326 // expected-error@+1 {{integer constant expression}}
327 #pragma omp distribute parallel for simd simdlen(foo())
328 for (i
= 0; i
< 16; ++i
)
332 // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}}
333 #pragma omp distribute parallel for simd simdlen(-5)
334 for (i
= 0; i
< 16; ++i
)
338 // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}}
339 #pragma omp distribute parallel for simd simdlen(0)
340 for (i
= 0; i
< 16; ++i
)
344 // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}}
345 #pragma omp distribute parallel for simd simdlen(5 - 5)
346 for (i
= 0; i
< 16; ++i
)
350 void test_safelen_simdlen(void) {
354 // expected-error@+1 {{the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter}}
355 #pragma omp distribute parallel for simd simdlen(6) safelen(5)
356 for (i
= 0; i
< 16; ++i
)
361 // expected-error@+1 {{the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter}}
362 #pragma omp distribute parallel for simd safelen(5) simdlen(6)
363 for (i
= 0; i
< 16; ++i
)
367 void test_collapse(void) {
371 // expected-error@+1 {{expected '('}}
372 #pragma omp distribute parallel for simd collapse
373 for (i
= 0; i
< 16; ++i
)
377 // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
378 #pragma omp distribute parallel for simd collapse(
379 for (i
= 0; i
< 16; ++i
)
383 // expected-error@+1 {{expected expression}}
384 #pragma omp distribute parallel for simd collapse()
385 for (i
= 0; i
< 16; ++i
)
389 // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
390 #pragma omp distribute parallel for simd collapse(,
391 for (i
= 0; i
< 16; ++i
)
395 // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
396 #pragma omp distribute parallel for simd collapse(, )
397 for (i
= 0; i
< 16; ++i
)
401 // expected-warning@+2 {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
402 // expected-error@+1 {{expected '('}}
403 #pragma omp distribute parallel for simd collapse 4)
404 for (i
= 0; i
< 16; ++i
)
408 // expected-error@+2 {{expected ')'}}
409 // expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
410 #pragma omp distribute parallel for simd collapse(4
411 for (i
= 0; i
< 16; ++i
)
412 ; // expected-error {{expected 4 for loops after '#pragma omp distribute parallel for simd', but found only 1}}
415 // expected-error@+2 {{expected ')'}}
416 // expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
417 #pragma omp distribute parallel for simd collapse(4,
418 for (i
= 0; i
< 16; ++i
)
419 ; // expected-error {{expected 4 for loops after '#pragma omp distribute parallel for simd', but found only 1}}
422 // expected-error@+2 {{expected ')'}}
423 // expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
424 #pragma omp distribute parallel for simd collapse(4, )
425 for (i
= 0; i
< 16; ++i
)
426 ; // expected-error {{expected 4 for loops after '#pragma omp distribute parallel for simd', but found only 1}}
429 // expected-note@+1 {{as specified in 'collapse' clause}}
430 #pragma omp distribute parallel for simd collapse(4)
431 for (i
= 0; i
< 16; ++i
)
432 ; // expected-error {{expected 4 for loops after '#pragma omp distribute parallel for simd', but found only 1}}
435 // expected-error@+2 {{expected ')'}}
436 // expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
437 #pragma omp distribute parallel for simd collapse(4 4)
438 for (i
= 0; i
< 16; ++i
)
439 ; // expected-error {{expected 4 for loops after '#pragma omp distribute parallel for simd', but found only 1}}
442 // expected-error@+2 {{expected ')'}}
443 // expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
444 #pragma omp distribute parallel for simd collapse(4, , 4)
445 for (i
= 0; i
< 16; ++i
)
446 ; // expected-error {{expected 4 for loops after '#pragma omp distribute parallel for simd', but found only 1}}
449 #pragma omp distribute parallel for simd collapse(4)
450 for (int i1
= 0; i1
< 16; ++i1
)
451 for (int i2
= 0; i2
< 16; ++i2
)
452 for (int i3
= 0; i3
< 16; ++i3
)
453 for (int i4
= 0; i4
< 16; ++i4
)
457 // expected-error@+2 {{expected ')'}}
458 // expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
459 #pragma omp distribute parallel for simd collapse(4, 8)
460 for (i
= 0; i
< 16; ++i
)
461 ; // expected-error {{expected 4 for loops after '#pragma omp distribute parallel for simd', but found only 1}}
464 // expected-error@+1 {{integer constant expression}}
465 #pragma omp distribute parallel for simd collapse(2.5)
466 for (i
= 0; i
< 16; ++i
)
470 // expected-error@+1 {{integer constant expression}}
471 #pragma omp distribute parallel for simd collapse(foo())
472 for (i
= 0; i
< 16; ++i
)
476 // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
477 #pragma omp distribute parallel for simd collapse(-5)
478 for (i
= 0; i
< 16; ++i
)
482 // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
483 #pragma omp distribute parallel for simd collapse(0)
484 for (i
= 0; i
< 16; ++i
)
488 // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
489 #pragma omp distribute parallel for simd collapse(5 - 5)
490 for (i
= 0; i
< 16; ++i
)
494 #pragma omp distribute parallel for simd collapse(2)
495 for (i
= 0; i
< 16; ++i
)
496 for (int j
= 0; j
< 16; ++j
)
497 // expected-error@+1 {{OpenMP constructs may not be nested inside a simd region}}
498 #pragma omp distribute parallel for simd reduction(+ : i, j)
499 for (int k
= 0; k
< 16; ++k
)
503 void test_linear(void) {
507 // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
508 #pragma omp distribute parallel for simd linear(
509 for (i
= 0; i
< 16; ++i
)
513 // expected-error@+2 {{expected expression}}
514 // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
515 #pragma omp distribute parallel for simd linear(,
516 for (i
= 0; i
< 16; ++i
)
520 // expected-error@+2 {{expected expression}}
521 // expected-error@+1 {{expected expression}}
522 #pragma omp distribute parallel for simd linear(, )
523 for (i
= 0; i
< 16; ++i
)
527 // expected-error@+1 {{expected expression}}
528 #pragma omp distribute parallel for simd linear()
529 for (i
= 0; i
< 16; ++i
)
533 // expected-error@+1 {{expected expression}}
534 #pragma omp distribute parallel for simd linear(int)
535 for (i
= 0; i
< 16; ++i
)
539 // expected-error@+1 {{expected variable name}}
540 #pragma omp distribute parallel for simd linear(0)
541 for (i
= 0; i
< 16; ++i
)
545 // expected-error@+1 {{use of undeclared identifier 'x'}}
546 #pragma omp distribute parallel for simd linear(x)
547 for (i
= 0; i
< 16; ++i
)
551 // expected-error@+2 {{use of undeclared identifier 'x'}}
552 // expected-error@+1 {{use of undeclared identifier 'y'}}
553 #pragma omp distribute parallel for simd linear(x, y)
554 for (i
= 0; i
< 16; ++i
)
558 // expected-error@+3 {{use of undeclared identifier 'x'}}
559 // expected-error@+2 {{use of undeclared identifier 'y'}}
560 // expected-error@+1 {{use of undeclared identifier 'z'}}
561 #pragma omp distribute parallel for simd linear(x, y, z)
562 for (i
= 0; i
< 16; ++i
)
566 void test_aligned(void) {
570 // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
571 #pragma omp distribute parallel for simd aligned(
572 for (i
= 0; i
< 16; ++i
)
574 // expected-error@+2 {{expected expression}}
575 // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
576 #pragma omp distribute parallel for simd aligned(,
577 for (i
= 0; i
< 16; ++i
)
581 // expected-error@+2 {{expected expression}}
582 // expected-error@+1 {{expected expression}}
583 #pragma omp distribute parallel for simd aligned(, )
584 for (i
= 0; i
< 16; ++i
)
588 // expected-error@+1 {{expected expression}}
589 #pragma omp distribute parallel for simd aligned()
590 for (i
= 0; i
< 16; ++i
)
594 // expected-error@+1 {{expected expression}}
595 #pragma omp distribute parallel for simd aligned(int)
596 for (i
= 0; i
< 16; ++i
)
600 // expected-error@+1 {{expected variable name}}
601 #pragma omp distribute parallel for simd aligned(0)
602 for (i
= 0; i
< 16; ++i
)
606 // expected-error@+1 {{use of undeclared identifier 'x'}}
607 #pragma omp distribute parallel for simd aligned(x)
608 for (i
= 0; i
< 16; ++i
)
612 // expected-error@+2 {{use of undeclared identifier 'x'}}
613 // expected-error@+1 {{use of undeclared identifier 'y'}}
614 #pragma omp distribute parallel for simd aligned(x, y)
615 for (i
= 0; i
< 16; ++i
)
619 // expected-error@+3 {{use of undeclared identifier 'x'}}
620 // expected-error@+2 {{use of undeclared identifier 'y'}}
621 // expected-error@+1 {{use of undeclared identifier 'z'}}
622 #pragma omp distribute parallel for simd aligned(x, y, z)
623 for (i
= 0; i
< 16; ++i
)
626 int *x
, y
, z
[25]; // expected-note 4 {{'y' defined here}}
629 #pragma omp distribute parallel for simd aligned(x)
630 for (i
= 0; i
< 16; ++i
)
634 #pragma omp distribute parallel for simd aligned(z)
635 for (i
= 0; i
< 16; ++i
)
639 // expected-error@+1 {{expected expression}}
640 #pragma omp distribute parallel for simd aligned(x :)
641 for (i
= 0; i
< 16; ++i
)
645 // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
646 #pragma omp distribute parallel for simd aligned(x :, )
647 for (i
= 0; i
< 16; ++i
)
651 #pragma omp distribute parallel for simd aligned(x : 1)
652 for (i
= 0; i
< 16; ++i
)
656 #pragma omp distribute parallel for simd aligned(x : 2 * 2)
657 for (i
= 0; i
< 16; ++i
)
661 // expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
662 #pragma omp distribute parallel for simd aligned(x : 1, y)
663 for (i
= 0; i
< 16; ++i
)
667 // expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
668 #pragma omp distribute parallel for simd aligned(x : 1, y, z : 1)
669 for (i
= 0; i
< 16; ++i
)
674 // expected-error@+1 {{argument of aligned clause should be array or pointer, not 'int'}}
675 #pragma omp distribute parallel for simd aligned(x, y)
676 for (i
= 0; i
< 16; ++i
)
680 // expected-error@+1 {{argument of aligned clause should be array or pointer, not 'int'}}
681 #pragma omp distribute parallel for simd aligned(x, y, z)
682 for (i
= 0; i
< 16; ++i
)
687 // expected-note@+2 {{defined as aligned}}
688 // expected-error@+1 {{a variable cannot appear in more than one aligned clause}}
689 #pragma omp distribute parallel for simd aligned(x) aligned(z, x)
690 for (i
= 0; i
< 16; ++i
)
695 // expected-note@+3 {{defined as aligned}}
696 // expected-error@+2 {{a variable cannot appear in more than one aligned clause}}
697 // expected-error@+1 2 {{argument of aligned clause should be array or pointer, not 'int'}}
698 #pragma omp distribute parallel for simd aligned(x, y, z) aligned(y, z)
699 for (i
= 0; i
< 16; ++i
)
704 void test_private(void) {
708 // expected-error@+2 {{expected expression}}
709 // expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
710 #pragma omp distribute parallel for simd private(
711 for (i
= 0; i
< 16; ++i
)
715 // expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
716 // expected-error@+1 2 {{expected expression}}
717 #pragma omp distribute parallel for simd private(,
718 for (i
= 0; i
< 16; ++i
)
722 // expected-error@+1 2 {{expected expression}}
723 #pragma omp distribute parallel for simd private(, )
724 for (i
= 0; i
< 16; ++i
)
728 // expected-error@+1 {{expected expression}}
729 #pragma omp distribute parallel for simd private()
730 for (i
= 0; i
< 16; ++i
)
734 // expected-error@+1 {{expected expression}}
735 #pragma omp distribute parallel for simd private(int)
736 for (i
= 0; i
< 16; ++i
)
740 // expected-error@+1 {{expected variable name}}
741 #pragma omp distribute parallel for simd private(0)
742 for (i
= 0; i
< 16; ++i
)
748 #pragma omp distribute parallel for simd private(x)
749 for (i
= 0; i
< 16; ++i
)
753 #pragma omp distribute parallel for simd private(x, y)
754 for (i
= 0; i
< 16; ++i
)
758 #pragma omp distribute parallel for simd private(x, y, z)
759 for (i
= 0; i
< 16; ++i
) {
764 void test_lastprivate(void) {
768 // expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
769 // expected-error@+1 {{expected expression}}
770 #pragma omp distribute parallel for simd lastprivate(
771 for (i
= 0; i
< 16; ++i
)
776 // expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
777 // expected-error@+1 2 {{expected expression}}
778 #pragma omp distribute parallel for simd lastprivate(,
779 for (i
= 0; i
< 16; ++i
)
783 // expected-error@+1 2 {{expected expression}}
784 #pragma omp distribute parallel for simd lastprivate(, )
785 for (i
= 0; i
< 16; ++i
)
789 // expected-error@+1 {{expected expression}}
790 #pragma omp distribute parallel for simd lastprivate()
791 for (i
= 0; i
< 16; ++i
)
795 // expected-error@+1 {{expected expression}}
796 #pragma omp distribute parallel for simd lastprivate(int)
797 for (i
= 0; i
< 16; ++i
)
801 // expected-error@+1 {{expected variable name}}
802 #pragma omp distribute parallel for simd lastprivate(0)
803 for (i
= 0; i
< 16; ++i
)
809 #pragma omp distribute parallel for simd lastprivate(x)
810 for (i
= 0; i
< 16; ++i
)
814 #pragma omp distribute parallel for simd lastprivate(x, y)
815 for (i
= 0; i
< 16; ++i
)
819 #pragma omp distribute parallel for simd lastprivate(x, y, z)
820 for (i
= 0; i
< 16; ++i
)
824 void test_firstprivate(void) {
828 // expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
829 // expected-error@+1 {{expected expression}}
830 #pragma omp distribute parallel for simd firstprivate(
831 for (i
= 0; i
< 16; ++i
)
836 // expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
837 // expected-error@+1 2 {{expected expression}}
838 #pragma omp distribute parallel for simd firstprivate(,
839 for (i
= 0; i
< 16; ++i
)
843 // expected-error@+1 2 {{expected expression}}
844 #pragma omp distribute parallel for simd firstprivate(, )
845 for (i
= 0; i
< 16; ++i
)
849 // expected-error@+1 {{expected expression}}
850 #pragma omp distribute parallel for simd firstprivate()
851 for (i
= 0; i
< 16; ++i
)
855 // expected-error@+1 {{expected expression}}
856 #pragma omp distribute parallel for simd firstprivate(int)
857 for (i
= 0; i
< 16; ++i
)
861 // expected-error@+1 {{expected variable name}}
862 #pragma omp distribute parallel for simd firstprivate(0)
863 for (i
= 0; i
< 16; ++i
)
867 // expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}}
870 #pragma omp distribute parallel for simd lastprivate(x) firstprivate(x)
871 for (i
= 0; i
< 16; ++i
)
873 // expected-error@+3 2 {{lastprivate variable cannot be firstprivate}} expected-note@+3 2 {{defined as lastprivate}}
876 #pragma omp distribute parallel for simd lastprivate(x, y) firstprivate(x, y)
877 for (i
= 0; i
< 16; ++i
)
879 // expected-error@+3 3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 3 {{defined as lastprivate}}
882 #pragma omp distribute parallel for simd lastprivate(x, y, z) firstprivate(x, y, z)
883 for (i
= 0; i
< 16; ++i
)
887 void test_loop_messages(void) {
888 float a
[100], b
[100], c
[100];
891 // expected-error@+2 {{variable must be of integer or pointer type}}
892 #pragma omp distribute parallel for simd
893 for (float fi
= 0; fi
< 10.0; fi
++) {
894 c
[(int)fi
] = a
[(int)fi
] + b
[(int)fi
];
898 // expected-error@+2 {{variable must be of integer or pointer type}}
899 #pragma omp distribute parallel for simd
900 for (double fi
= 0; fi
< 10.0; fi
++) {
901 c
[(int)fi
] = a
[(int)fi
] + b
[(int)fi
];
905 void test_nontemporal(void) {
907 // omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
908 #pragma omp distribute parallel for simd nontemporal(
909 for (i
= 0; i
< 16; ++i
)
911 // omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 2 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
912 #pragma omp distribute parallel for simd nontemporal(,
913 for (i
= 0; i
< 16; ++i
)
915 // omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 2 {{expected expression}}
916 #pragma omp distribute parallel for simd nontemporal(, )
917 for (i
= 0; i
< 16; ++i
)
919 // omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 {{expected expression}}
920 #pragma omp distribute parallel for simd nontemporal()
921 for (i
= 0; i
< 16; ++i
)
923 // omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 {{expected expression}}
924 #pragma omp distribute parallel for simd nontemporal(int)
925 for (i
= 0; i
< 16; ++i
)
927 // omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} omp50-error@+1 {{expected variable name}} omp51-error@+1 {{expected variable name}}
928 #pragma omp distribute parallel for simd nontemporal(0)
929 for (i
= 0; i
< 16; ++i
)
931 // omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'x'}}
932 #pragma omp distribute parallel for simd nontemporal(x)
933 for (i
= 0; i
< 16; ++i
)
935 // expected-error@+2 {{use of undeclared identifier 'x'}}
936 // omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'y'}}
937 #pragma omp distribute parallel for simd nontemporal(x, y)
938 for (i
= 0; i
< 16; ++i
)
940 // expected-error@+3 {{use of undeclared identifier 'x'}}
941 // expected-error@+2 {{use of undeclared identifier 'y'}}
942 // omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'z'}}
943 #pragma omp distribute parallel for simd nontemporal(x, y, z)
944 for (i
= 0; i
< 16; ++i
)
948 // omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
949 #pragma omp distribute parallel for simd nontemporal(x :)
950 for (i
= 0; i
< 16; ++i
)
952 // omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}}
953 #pragma omp distribute parallel for simd nontemporal(x :, )
954 for (i
= 0; i
< 16; ++i
)
957 // omp51-note@+3 {{defined as nontemporal}}
958 // omp50-note@+2 {{defined as nontemporal}}
959 // omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} omp51-error@+1 {{a variable cannot appear in more than one nontemporal clause}}
960 #pragma omp distribute parallel for simd nontemporal(x) nontemporal(x)
961 for (i
= 0; i
< 16; ++i
)
964 // omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}}
965 #pragma omp distribute parallel for simd private(x) nontemporal(x)
966 for (i
= 0; i
< 16; ++i
)
969 // omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}}
970 #pragma omp distribute parallel for simd nontemporal(x) private(x)
971 for (i
= 0; i
< 16; ++i
)
974 // omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}}
975 #pragma omp distribute parallel for simd nontemporal(x, y : 0)
976 for (i
= 0; i
< 16; ++i
)
979 // omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}}
980 #pragma omp distribute parallel for simd nontemporal(x) lastprivate(x)
981 for (i
= 0; i
< 16; ++i
)
984 // omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}}
985 #pragma omp distribute parallel for simd lastprivate(x) nontemporal(x)
986 for (i
= 0; i
< 16; ++i
)
988 #pragma omp distribute parallel for simd order // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} expected-error {{expected '(' after 'order'}}
989 for (int i
= 0; i
< 10; ++i
)
991 #pragma omp distribute parallel for simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}}
992 for (int i
= 0; i
< 10; ++i
)
994 #pragma omp distribute parallel for simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}}
995 for (int i
= 0; i
< 10; ++i
)
997 #pragma omp distribute parallel for simd order(concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
998 for (int i
= 0; i
< 10; ++i
)
1000 #pragma omp distribute parallel for simd order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}}
1001 for (int i
= 0; i
< 10; ++i
)
1003 #pragma omp distribute parallel for simd order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}}
1004 for (int i
= 0; i
< 10; ++i
)
1006 #pragma omp distribute parallel for simd order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}}
1007 for (int i
= 0; i
< 10; ++i
)
1009 #pragma omp distribute parallel for simd order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}}
1010 for (int i
= 0; i
< 10; ++i
)
1012 #pragma omp distribute parallel for simd order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}}
1013 for (int i
= 0; i
< 10; ++i
)
1015 #pragma omp distribute parallel for simd order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} omp51-error {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'order' clause}}
1016 for (int i
= 0; i
< 10; ++i
)