1 // RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
9 S(const S &s) : a(s.a) {}
13 // expected-note@+1 {{defined as threadprivate or thread local}}
14 #pragma omp threadprivate(sii)
17 int test_iteration_spaces() {
19 float a[N], b[N], c[N];
25 #pragma omp distribute parallel for simd
26 for (int i = 0; i < 10; i += 1) {
31 #pragma omp distribute parallel for simd
32 for (char i = 0; i < 10; i++) {
37 #pragma omp distribute parallel for simd
38 for (char i = 0; i < 10; i += '\1') {
43 #pragma omp distribute parallel for simd
44 for (long long i = 0; i < 10; i++) {
49 // expected-error@+2 {{expression must have integral or unscoped enumeration type, not 'double'}}
50 #pragma omp distribute parallel for simd
51 for (long long i = 0; i < 10; i += 1.5) {
56 #pragma omp distribute parallel for simd
57 for (long long i = 0; i < 'z'; i += 1u) {
62 // expected-error@+2 {{variable must be of integer or random access iterator type}}
63 #pragma omp distribute parallel for simd
64 for (float fi = 0; fi < 10.0; fi++) {
65 c[(int)fi] = a[(int)fi] + b[(int)fi];
69 // expected-error@+2 {{variable must be of integer or random access iterator type}}
70 #pragma omp distribute parallel for simd
71 for (double fi = 0; fi < 10.0; fi++) {
72 c[(int)fi] = a[(int)fi] + b[(int)fi];
76 // expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
77 #pragma omp distribute parallel for simd
78 for (int &ref = ii; ref < 10; ref++) {
82 // expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
83 #pragma omp distribute parallel for simd
84 for (int i; i < 10; i++)
89 // expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
90 #pragma omp distribute parallel for simd
91 for (int i = 0, j = 0; i < 10; ++i)
96 // expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
97 #pragma omp distribute parallel for simd
103 // expected-warning@+3 {{expression result unused}}
104 // expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
105 #pragma omp distribute parallel for simd
106 for (ii + 1; ii < 10; ++ii)
111 // expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
112 #pragma omp distribute parallel for simd
113 for (c[ii] = 0; ii < 10; ++ii)
118 // Ok to skip parenthesises.
119 #pragma omp distribute parallel for simd
120 for (((ii)) = 0; ii < 10; ++ii)
125 // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
126 #pragma omp distribute parallel for simd
127 for (int i = 0; i; i++)
132 // expected-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
133 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
134 #pragma omp distribute parallel for simd
135 for (int i = 0; jj < kk; ii++)
140 // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
141 #pragma omp distribute parallel for simd
142 for (int i = 0; !!i; i++)
147 // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
148 #pragma omp distribute parallel for simd
149 for (int i = 0; i != 1; i++)
154 // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
155 #pragma omp distribute parallel for simd
156 for (int i = 0;; i++)
162 #pragma omp distribute parallel for simd
163 for (int i = 11; i > 10; i--)
169 #pragma omp distribute parallel for simd
170 for (int i = 0; i < 10; ++i)
176 #pragma omp distribute parallel for simd
177 for (ii = 0; ii < 10; ++ii)
182 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
183 #pragma omp distribute parallel for simd
184 for (ii = 0; ii < 10; ++jj)
189 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
190 #pragma omp distribute parallel for simd
191 for (ii = 0; ii < 10; ++++ii)
194 // Ok but undefined behavior (in general, cannot check that incr
195 // is really loop-invariant).
198 #pragma omp distribute parallel for simd
199 for (ii = 0; ii < 10; ii = ii + ii)
204 // expected-error@+2 {{expression must have integral or unscoped enumeration type, not 'float'}}
205 #pragma omp distribute parallel for simd
206 for (ii = 0; ii < 10; ii = ii + 1.0f)
209 // Ok - step was converted to integer type.
212 #pragma omp distribute parallel for simd
213 for (ii = 0; ii < 10; ii = ii + (int)1.1f)
218 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
219 #pragma omp distribute parallel for simd
220 for (ii = 0; ii < 10; jj = ii + 2)
225 // expected-warning@+3 {{relational comparison result unused}}
226 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
227 #pragma omp distribute parallel for simd
228 for (ii = 0; ii<10; jj> kk + 2)
233 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
234 #pragma omp distribute parallel for simd
235 for (ii = 0; ii < 10;)
240 // expected-warning@+3 {{expression result unused}}
241 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
242 #pragma omp distribute parallel for simd
243 for (ii = 0; ii < 10; !ii)
248 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
249 #pragma omp distribute parallel for simd
250 for (ii = 0; ii < 10; ii ? ++ii : ++jj)
255 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
256 #pragma omp distribute parallel for simd
257 for (ii = 0; ii < 10; ii = ii < 10)
262 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
263 // expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
264 #pragma omp distribute parallel for simd
265 for (ii = 0; ii < 10; ii = ii + 0)
270 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
271 // expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
272 #pragma omp distribute parallel for simd
273 for (ii = 0; ii < 10; ii = ii + (int)(0.8 - 0.45))
278 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
279 // expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
280 #pragma omp distribute parallel for simd
281 for (ii = 0; (ii) < 10; ii -= 25)
286 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
287 // expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
288 #pragma omp distribute parallel for simd
289 for (ii = 0; (ii < 10); ii -= 0)
294 // expected-note@+3 {{loop step is expected to be negative due to this condition}}
295 // expected-error@+2 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
296 #pragma omp distribute parallel for simd
297 for (ii = 0; ii > 10; (ii += 0))
302 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
303 // expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
304 #pragma omp distribute parallel for simd
305 for (ii = 0; ii < 10; (ii) = (1 - 1) + (ii))
310 // expected-note@+3 {{loop step is expected to be negative due to this condition}}
311 // expected-error@+2 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
312 #pragma omp distribute parallel for simd
313 for ((ii = 0); ii > 10; (ii -= 0))
318 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
319 // expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
320 #pragma omp distribute parallel for simd
321 for (ii = 0; (ii < 10); (ii -= 0))
326 // expected-note@+2 {{defined as firstprivate}}
327 // expected-error@+2 {{loop iteration variable in the associated loop of 'omp distribute parallel for simd' directive may not be firstprivate, predetermined as linear}}
328 #pragma omp distribute parallel for simd firstprivate(ii)
329 for (ii = 0; ii < 10; ii++)
334 #pragma omp distribute parallel for simd linear(ii)
335 for (ii = 0; ii < 10; ii++)
340 // expected-note@+2 {{defined as private}}
341 // expected-error@+2 {{loop iteration variable in the associated loop of 'omp distribute parallel for simd' directive may not be private, predetermined as linear}}
342 #pragma omp distribute parallel for simd private(ii)
343 for (ii = 0; ii < 10; ii++)
348 // expected-note@+2 {{defined as lastprivate}}
349 // expected-error@+2 {{loop iteration variable in the associated loop of 'omp distribute parallel for simd' directive may not be lastprivate, predetermined as linear}}
350 #pragma omp distribute parallel for simd lastprivate(ii)
351 for (ii = 0; ii < 10; ii++)
355 // expected-error@+2 {{loop iteration variable in the associated loop of 'omp distribute parallel for simd' directive may not be threadprivate or thread local, predetermined as linear}}
356 #pragma omp distribute parallel for simd
357 for (sii = 0; sii < 10; sii += 1)
362 #pragma omp distribute parallel for simd
363 for (globalii = 0; globalii < 10; globalii += 1)
364 c[globalii] = a[globalii];
370 #pragma omp distribute parallel for simd collapse(2)
371 for (ii = 0; ii < 10; ii += 1)
372 for (globalii = 0; globalii < 10; globalii += 1)
373 c[globalii] += a[globalii] + ii;
378 // expected-error@+2 {{statement after '#pragma omp distribute parallel for simd' must be a for loop}}
379 #pragma omp distribute parallel for simd
380 for (auto &item : a) {
386 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
387 // expected-error@+2 {{increment expression must cause 'i' to increase on each iteration of OpenMP for loop}}
388 #pragma omp distribute parallel for simd
389 for (unsigned i = 9; i < 10; i--) {
393 int(*lb)[4] = nullptr;
396 #pragma omp distribute parallel for simd
397 for (int(*p)[4] = lb; p < lb + 8; ++p) {
402 // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
403 #pragma omp distribute parallel for simd
404 for (int a{0}; a < 10; ++a) {
410 // Iterators allowed in openmp for-loops.
412 struct random_access_iterator_tag {};
413 template <class Iter>
414 struct iterator_traits {
415 typedef typename Iter::difference_type difference_type;
416 typedef typename Iter::iterator_category iterator_category;
418 template <class Iter>
419 typename iterator_traits<Iter>::difference_type
420 distance(Iter first, Iter last) { return first - last; }
425 Iter0(const Iter0 &) {}
426 Iter0 operator++() { return *this; }
427 Iter0 operator--() { return *this; }
428 bool operator<(Iter0 a) { return true; }
430 // expected-note@+2 {{candidate function not viable: no known conversion from 'GoodIter' to 'Iter0' for 1st argument}}
431 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'Iter0' for 1st argument}}
432 int operator-(Iter0 a, Iter0 b) { return 0; }
435 Iter1(float f = 0.0f, double d = 0.0) {}
436 Iter1(const Iter1 &) {}
437 Iter1 operator++() { return *this; }
438 Iter1 operator--() { return *this; }
439 bool operator<(Iter1 a) { return true; }
440 bool operator>=(Iter1 a) { return false; }
445 GoodIter(const GoodIter &) {}
446 GoodIter(int fst, int snd) {}
447 GoodIter &operator=(const GoodIter &that) { return *this; }
448 GoodIter &operator=(const Iter0 &that) { return *this; }
449 GoodIter &operator+=(int x) { return *this; }
450 explicit GoodIter(void *) {}
451 GoodIter operator++() { return *this; }
452 GoodIter operator--() { return *this; }
453 bool operator!() { return true; }
454 bool operator<(GoodIter a) { return true; }
455 bool operator<=(GoodIter a) { return true; }
456 bool operator>=(GoodIter a) { return false; }
457 typedef int difference_type;
458 typedef std::random_access_iterator_tag iterator_category;
460 // expected-note@+2 {{candidate function not viable: no known conversion from 'const Iter0' to 'GoodIter' for 2nd argument}}
461 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'GoodIter' for 1st argument}}
462 int operator-(GoodIter a, GoodIter b) { return 0; }
463 // expected-note@+1 3 {{candidate function not viable: requires single argument 'a', but 2 arguments were provided}}
464 GoodIter operator-(GoodIter a) { return a; }
465 // expected-note@+2 {{candidate function not viable: no known conversion from 'const Iter0' to 'int' for 2nd argument}}
466 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'GoodIter' for 1st argument}}
467 GoodIter operator-(GoodIter a, int v) { return GoodIter(); }
468 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter0' to 'GoodIter' for 1st argument}}
469 GoodIter operator+(GoodIter a, int v) { return GoodIter(); }
470 // expected-note@+2 {{candidate function not viable: no known conversion from 'GoodIter' to 'int' for 1st argument}}
471 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'int' for 1st argument}}
472 GoodIter operator-(int v, GoodIter a) { return GoodIter(); }
473 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter0' to 'int' for 1st argument}}
474 GoodIter operator+(int v, GoodIter a) { return GoodIter(); }
476 int test_with_random_access_iterator() {
481 #pragma omp distribute parallel for simd
482 for (GoodIter I = begin; I < end; ++I)
486 // expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
487 #pragma omp distribute parallel for simd
488 for (GoodIter &I = begin; I < end; ++I)
492 #pragma omp distribute parallel for simd
493 for (GoodIter I = begin; I >= end; --I)
497 // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
498 #pragma omp distribute parallel for simd
499 for (GoodIter I(begin); I < end; ++I)
503 // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
504 #pragma omp distribute parallel for simd
505 for (GoodIter I(nullptr); I < end; ++I)
509 // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
510 #pragma omp distribute parallel for simd
511 for (GoodIter I(0); I < end; ++I)
515 // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
516 #pragma omp distribute parallel for simd
517 for (GoodIter I(1, 2); I < end; ++I)
521 #pragma omp distribute parallel for simd
522 for (begin = GoodIter(0); begin < end; ++begin)
526 // expected-error@+3 {{invalid operands to binary expression ('GoodIter' and 'const Iter0')}}
527 // expected-error@+2 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
528 #pragma omp distribute parallel for simd
529 for (begin = begin0; begin < end; ++begin)
533 // expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
534 #pragma omp distribute parallel for simd
535 for (++begin; begin < end; ++begin)
539 #pragma omp distribute parallel for simd
540 for (begin = end; begin < end; ++begin)
544 // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
545 #pragma omp distribute parallel for simd
546 for (GoodIter I = begin; I - I; ++I)
550 // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
551 #pragma omp distribute parallel for simd
552 for (GoodIter I = begin; begin < end; ++I)
556 // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
557 #pragma omp distribute parallel for simd
558 for (GoodIter I = begin; !I; ++I)
562 // expected-note@+3 {{loop step is expected to be negative due to this condition}}
563 // expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
564 #pragma omp distribute parallel for simd
565 for (GoodIter I = begin; I >= end; I = I + 1)
569 #pragma omp distribute parallel for simd
570 for (GoodIter I = begin; I >= end; I = I - 1)
574 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'I'}}
575 #pragma omp distribute parallel for simd
576 for (GoodIter I = begin; I >= end; I = -I)
580 // expected-note@+3 {{loop step is expected to be negative due to this condition}}
581 // expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
582 #pragma omp distribute parallel for simd
583 for (GoodIter I = begin; I >= end; I = 2 + I)
587 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'I'}}
588 #pragma omp distribute parallel for simd
589 for (GoodIter I = begin; I >= end; I = 2 - I)
593 // expected-error@+2 {{invalid operands to binary expression ('Iter0' and 'int')}}
594 #pragma omp distribute parallel for simd
595 for (Iter0 I = begin0; I < end0; ++I)
599 // Initializer is constructor without params.
600 // expected-error@+3 {{invalid operands to binary expression ('Iter0' and 'int')}}
601 // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
602 #pragma omp distribute parallel for simd
603 for (Iter0 I; I < end0; ++I)
608 // expected-error@+3 {{invalid operands to binary expression ('Iter1' and 'Iter1')}}
609 // expected-error@+2 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
610 #pragma omp distribute parallel for simd
611 for (Iter1 I = begin1; I < end1; ++I)
615 // expected-note@+3 {{loop step is expected to be negative due to this condition}}
616 // expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
617 #pragma omp distribute parallel for simd
618 for (Iter1 I = begin1; I >= end1; ++I)
622 // expected-error@+5 {{invalid operands to binary expression ('Iter1' and 'float')}}
623 // expected-error@+4 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
624 // Initializer is constructor with all default params.
625 // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
626 #pragma omp distribute parallel for simd
627 for (Iter1 I; I < end1; ++I) {
632 template <typename IT, int ST>
635 int dotest_lt(IT begin, IT end) {
638 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
639 // expected-error@+2 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
640 #pragma omp distribute parallel for simd
641 for (IT I = begin; I < end; I = I + ST) {
646 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
647 // expected-error@+2 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
648 #pragma omp distribute parallel for simd
649 for (IT I = begin; I <= end; I += ST) {
654 #pragma omp distribute parallel for simd
655 for (IT I = begin; I < end; ++I) {
664 template <typename IT, int ST = 0>
665 int dotest_gt(IT begin, IT end) {
668 // expected-note@+3 2 {{loop step is expected to be negative due to this condition}}
669 // expected-error@+2 2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
670 #pragma omp distribute parallel for simd
671 for (IT I = begin; I >= end; I = I + ST) {
676 // expected-note@+3 2 {{loop step is expected to be negative due to this condition}}
677 // expected-error@+2 2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
678 #pragma omp distribute parallel for simd
679 for (IT I = begin; I >= end; I += ST) {
685 // expected-note@+3 {{loop step is expected to be negative due to this condition}}
686 // expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
687 #pragma omp distribute parallel for simd
688 for (IT I = begin; I >= end; ++I) {
692 #pragma omp distribute parallel for simd
693 for (IT I = begin; I < end; I += TC<int, ST>::step()) {
698 void test_with_template() {
700 TC<GoodIter, 100> t1;
701 TC<GoodIter, -100> t2;
702 t1.dotest_lt(begin, end);
703 t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
704 dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
705 dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
708 void test_loop_break() {
710 float a[N], b[N], c[N];
713 #pragma omp distribute parallel for simd
714 for (int i = 0; i < 10; i++) {
716 for (int j = 0; j < 10; ++j) {
718 break; // OK in nested loop
728 break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
731 break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
736 #pragma omp distribute parallel for simd
737 for (int i = 0; i < 10; i++) {
738 for (int j = 0; j < 10; j++) {
749 void test_loop_eh() {
751 float a[N], b[N], c[N];
754 #pragma omp distribute parallel for simd
755 for (int i = 0; i < 10; i++) {
757 try { // expected-error {{'try' statement cannot be used in OpenMP simd region}}
758 for (int j = 0; j < 10; ++j) {
760 throw a[i]; // expected-error {{'throw' statement cannot be used in OpenMP simd region}}
762 throw a[i]; // expected-error {{'throw' statement cannot be used in OpenMP simd region}}
765 throw a[i]; // expected-error {{'throw' statement cannot be used in OpenMP simd region}}
766 return; // expected-error {{cannot return from OpenMP region}}
775 for (int j = 0; j < 10; j++) {
777 throw c[i]; // expected-error {{'throw' statement cannot be used in OpenMP simd region}}
783 #pragma omp distribute parallel for simd
784 for (int i = 0; i < 10; ++i) {
786 void g() { throw 0; }
791 void test_loop_firstprivate_lastprivate() {
795 #pragma omp distribute parallel for simd lastprivate(s) firstprivate(s)
796 for (int i = 0; i < 16; ++i)
800 void test_ordered() {
803 #pragma omp distribute parallel for simd ordered // expected-error {{unexpected OpenMP clause 'ordered' in directive '#pragma omp distribute parallel for simd'}}
804 for (int i = 0; i < 16; ++i)
811 // expected-error@+1 2 {{unexpected OpenMP clause 'nowait' in directive '#pragma omp distribute parallel for simd'}}
812 #pragma omp distribute parallel for simd nowait nowait // expected-error {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'nowait' clause}}
813 for (int i = 0; i < 16; ++i)