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];
24 #pragma omp teams distribute parallel for simd
25 for (int i = 0; i < 10; i += 1) {
29 #pragma omp teams distribute parallel for simd
30 for (char i = 0; i < 10; i++) {
34 #pragma omp teams distribute parallel for simd
35 for (char i = 0; i < 10; i += '\1') {
39 #pragma omp teams distribute parallel for simd
40 for (long long i = 0; i < 10; i++) {
44 #pragma omp teams distribute parallel for simd
45 // expected-error@+1 {{expression must have integral or unscoped enumeration type, not 'double'}}
46 for (long long i = 0; i < 10; i += 1.5) {
50 #pragma omp teams distribute parallel for simd
51 for (long long i = 0; i < 'z'; i += 1u) {
55 #pragma omp teams distribute parallel for simd
56 // expected-error@+1 {{variable must be of integer or random access iterator type}}
57 for (float fi = 0; fi < 10.0; fi++) {
58 c[(int)fi] = a[(int)fi] + b[(int)fi];
61 #pragma omp teams distribute parallel for simd
62 // expected-error@+1 {{variable must be of integer or random access iterator type}}
63 for (double fi = 0; fi < 10.0; fi++) {
64 c[(int)fi] = a[(int)fi] + b[(int)fi];
67 #pragma omp teams distribute parallel for simd
68 // expected-error@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
69 for (int &ref = ii; ref < 10; ref++) {
72 #pragma omp teams distribute parallel for simd
73 // expected-error@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
74 for (int i; i < 10; i++)
78 #pragma omp teams distribute parallel for simd
79 // expected-error@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
80 for (int i = 0, j = 0; i < 10; ++i)
84 #pragma omp teams distribute parallel for simd
85 // expected-error@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
90 #pragma omp teams distribute parallel for simd
91 // expected-warning@+2 {{expression result unused}}
92 // expected-error@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
93 for (ii + 1; ii < 10; ++ii)
97 #pragma omp teams distribute parallel for simd
98 // expected-error@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
99 for (c[ii] = 0; ii < 10; ++ii)
103 #pragma omp teams distribute parallel for simd
104 // Ok to skip parenthesises.
105 for (((ii)) = 0; ii < 10; ++ii)
109 #pragma omp teams distribute parallel for simd
110 // expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
111 for (int i = 0; i; i++)
115 #pragma omp teams distribute parallel for simd
116 // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
117 // expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
118 for (int i = 0; jj < kk; ii++)
122 #pragma omp teams distribute parallel for simd
123 // expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
124 for (int i = 0; !!i; i++)
128 #pragma omp teams distribute parallel for simd
129 // expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
130 for (int i = 0; i != 1; i++)
134 #pragma omp teams distribute parallel for simd
135 // expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
136 for (int i = 0;; i++)
141 #pragma omp teams distribute parallel for simd
142 for (int i = 11; i > 10; i--)
147 #pragma omp teams distribute parallel for simd
148 for (int i = 0; i < 10; ++i)
153 #pragma omp teams distribute parallel for simd
154 for (ii = 0; ii < 10; ++ii)
158 #pragma omp teams distribute parallel for simd
159 // expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
160 for (ii = 0; ii < 10; ++jj)
164 #pragma omp teams distribute parallel for simd
165 // expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
166 for (ii = 0; ii < 10; ++++ii)
169 // Ok but undefined behavior (in general, cannot check that incr
170 // is really loop-invariant).
172 #pragma omp teams distribute parallel for simd
173 for (ii = 0; ii < 10; ii = ii + ii)
177 #pragma omp teams distribute parallel for simd
178 // expected-error@+1 {{expression must have integral or unscoped enumeration type, not 'float'}}
179 for (ii = 0; ii < 10; ii = ii + 1.0f)
182 // Ok - step was converted to integer type.
184 #pragma omp teams distribute parallel for simd
185 for (ii = 0; ii < 10; ii = ii + (int)1.1f)
189 #pragma omp teams distribute parallel for simd
190 // expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
191 for (ii = 0; ii < 10; jj = ii + 2)
195 #pragma omp teams distribute parallel for simd
196 // expected-warning@+2 {{relational comparison result unused}}
197 // expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
198 for (ii = 0; ii<10; jj> kk + 2)
202 #pragma omp teams distribute parallel for simd
203 // expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
204 for (ii = 0; ii < 10;)
208 #pragma omp teams distribute parallel for simd
209 // expected-warning@+2 {{expression result unused}}
210 // expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
211 for (ii = 0; ii < 10; !ii)
215 #pragma omp teams distribute parallel for simd
216 // expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
217 for (ii = 0; ii < 10; ii ? ++ii : ++jj)
221 #pragma omp teams distribute parallel for simd
222 // expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
223 for (ii = 0; ii < 10; ii = ii < 10)
227 #pragma omp teams distribute parallel for simd
228 // expected-note@+2 {{loop step is expected to be positive due to this condition}}
229 // expected-error@+1 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
230 for (ii = 0; ii < 10; ii = ii + 0)
234 #pragma omp teams distribute parallel for simd
235 // expected-note@+2 {{loop step is expected to be positive due to this condition}}
236 // expected-error@+1 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
237 for (ii = 0; ii < 10; ii = ii + (int)(0.8 - 0.45))
241 #pragma omp teams distribute parallel for simd
242 // expected-note@+2 {{loop step is expected to be positive due to this condition}}
243 // expected-error@+1 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
244 for (ii = 0; (ii) < 10; ii -= 25)
248 #pragma omp teams distribute parallel for simd
249 // expected-note@+2 {{loop step is expected to be positive due to this condition}}
250 // expected-error@+1 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
251 for (ii = 0; (ii < 10); ii -= 0)
255 #pragma omp teams distribute parallel for simd
256 // expected-note@+2 {{loop step is expected to be negative due to this condition}}
257 // expected-error@+1 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
258 for (ii = 0; ii > 10; (ii += 0))
262 #pragma omp teams distribute parallel for simd
263 // expected-note@+2 {{loop step is expected to be positive due to this condition}}
264 // expected-error@+1 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
265 for (ii = 0; ii < 10; (ii) = (1 - 1) + (ii))
269 #pragma omp teams distribute parallel for simd
270 // expected-note@+2 {{loop step is expected to be negative due to this condition}}
271 // expected-error@+1 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
272 for ((ii = 0); ii > 10; (ii -= 0))
276 #pragma omp teams distribute parallel for simd
277 // expected-note@+2 {{loop step is expected to be positive due to this condition}}
278 // expected-error@+1 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
279 for (ii = 0; (ii < 10); (ii -= 0))
283 #pragma omp teams distribute parallel for simd firstprivate(ii) // expected-note {{defined as firstprivate}}
284 // expected-error@+1 {{loop iteration variable in the associated loop of 'omp teams distribute parallel for simd' directive may not be firstprivate, predetermined as linear}}
285 for (ii = 0; ii < 10; ii++)
289 #pragma omp teams distribute parallel for simd private(ii) // expected-note {{defined as private}}
290 // expected-error@+1 {{loop iteration variable in the associated loop of 'omp teams distribute parallel for simd' directive may not be private, predetermined as linear}}
291 for (ii = 0; ii < 10; ii++)
295 #pragma omp teams distribute parallel for simd lastprivate(ii) // expected-note {{defined as lastprivate}}
296 // expected-error@+1 {{loop iteration variable in the associated loop of 'omp teams distribute parallel for simd' directive may not be lastprivate, predetermined as linear}}
297 for (ii = 0; ii < 10; ii++)
301 #pragma omp teams distribute parallel for simd
302 // expected-error@+1 {{loop iteration variable in the associated loop of 'omp teams distribute parallel for simd' directive may not be threadprivate or thread local, predetermined as linear}}
303 for (sii = 0; sii < 10; sii++)
308 #pragma omp teams distribute parallel for simd collapse(2)
309 for (ii = 0; ii < 10; ii += 1)
310 for (globalii = 0; globalii < 10; globalii += 1)
311 c[globalii] += a[globalii] + ii;
315 #pragma omp teams distribute parallel for simd
316 // expected-error@+1 {{statement after '#pragma omp teams distribute parallel for simd' must be a for loop}}
317 for (auto &item : a) {
322 #pragma omp teams distribute parallel for simd
323 // expected-note@+2 {{loop step is expected to be positive due to this condition}}
324 // expected-error@+1 {{increment expression must cause 'i' to increase on each iteration of OpenMP for loop}}
325 for (unsigned i = 9; i < 10; i--) {
329 int(*lb)[4] = nullptr;
331 #pragma omp teams distribute parallel for simd
332 for (int(*p)[4] = lb; p < lb + 8; ++p) {
336 #pragma omp teams distribute parallel for simd
337 // expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
338 for (int a{0}; a < 10; ++a) {
344 // Iterators allowed in openmp for-loops.
346 struct random_access_iterator_tag {};
347 template <class Iter>
348 struct iterator_traits {
349 typedef typename Iter::difference_type difference_type;
350 typedef typename Iter::iterator_category iterator_category;
352 template <class Iter>
353 typename iterator_traits<Iter>::difference_type
354 distance(Iter first, Iter last) { return first - last; }
359 Iter0(const Iter0 &) {}
360 Iter0 operator++() { return *this; }
361 Iter0 operator--() { return *this; }
362 bool operator<(Iter0 a) { return true; }
364 // expected-note@+2 {{candidate function not viable: no known conversion from 'GoodIter' to 'Iter0' for 1st argument}}
365 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'Iter0' for 1st argument}}
366 int operator-(Iter0 a, Iter0 b) { return 0; }
369 Iter1(float f = 0.0f, double d = 0.0) {}
370 Iter1(const Iter1 &) {}
371 Iter1 operator++() { return *this; }
372 Iter1 operator--() { return *this; }
373 bool operator<(Iter1 a) { return true; }
374 bool operator>=(Iter1 a) { return false; }
379 GoodIter(const GoodIter &) {}
380 GoodIter(int fst, int snd) {}
381 GoodIter &operator=(const GoodIter &that) { return *this; }
382 GoodIter &operator=(const Iter0 &that) { return *this; }
383 GoodIter &operator+=(int x) { return *this; }
384 explicit GoodIter(void *) {}
385 GoodIter operator++() { return *this; }
386 GoodIter operator--() { return *this; }
387 bool operator!() { return true; }
388 bool operator<(GoodIter a) { return true; }
389 bool operator<=(GoodIter a) { return true; }
390 bool operator>=(GoodIter a) { return false; }
391 typedef int difference_type;
392 typedef std::random_access_iterator_tag iterator_category;
394 // expected-note@+2 {{candidate function not viable: no known conversion from 'const Iter0' to 'GoodIter' for 2nd argument}}
395 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'GoodIter' for 1st argument}}
396 int operator-(GoodIter a, GoodIter b) { return 0; }
397 // expected-note@+1 3 {{candidate function not viable: requires single argument 'a', but 2 arguments were provided}}
398 GoodIter operator-(GoodIter a) { return a; }
399 // expected-note@+2 {{candidate function not viable: no known conversion from 'const Iter0' to 'int' for 2nd argument}}
400 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'GoodIter' for 1st argument}}
401 GoodIter operator-(GoodIter a, int v) { return GoodIter(); }
402 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter0' to 'GoodIter' for 1st argument}}
403 GoodIter operator+(GoodIter a, int v) { return GoodIter(); }
404 // expected-note@+2 {{candidate function not viable: no known conversion from 'GoodIter' to 'int' for 1st argument}}
405 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'int' for 1st argument}}
406 GoodIter operator-(int v, GoodIter a) { return GoodIter(); }
407 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter0' to 'int' for 1st argument}}
408 GoodIter operator+(int v, GoodIter a) { return GoodIter(); }
410 int test_with_random_access_iterator() {
414 #pragma omp teams distribute parallel for simd
415 for (GoodIter I = begin; I < end; ++I)
418 #pragma omp teams distribute parallel for simd
419 // expected-error@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
420 for (GoodIter &I = begin; I < end; ++I)
423 #pragma omp teams distribute parallel for simd
424 for (GoodIter I = begin; I >= end; --I)
427 #pragma omp teams distribute parallel for simd
428 // expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
429 for (GoodIter I(begin); I < end; ++I)
432 #pragma omp teams distribute parallel for simd
433 // expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
434 for (GoodIter I(nullptr); I < end; ++I)
437 #pragma omp teams distribute parallel for simd
438 // expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
439 for (GoodIter I(0); I < end; ++I)
442 #pragma omp teams distribute parallel for simd
443 // expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
444 for (GoodIter I(1, 2); I < end; ++I)
447 #pragma omp teams distribute parallel for simd
448 for (begin = GoodIter(0); begin < end; ++begin)
451 #pragma omp teams distribute parallel for simd
452 // expected-error@+2 {{invalid operands to binary expression ('GoodIter' and 'const Iter0')}}
453 // expected-error@+1 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
454 for (begin = begin0; begin < end; ++begin)
457 #pragma omp teams distribute parallel for simd
458 // expected-error@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
459 for (++begin; begin < end; ++begin)
462 #pragma omp teams distribute parallel for simd
463 for (begin = end; begin < end; ++begin)
466 #pragma omp teams distribute parallel for simd
467 // expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
468 for (GoodIter I = begin; I - I; ++I)
471 #pragma omp teams distribute parallel for simd
472 // expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
473 for (GoodIter I = begin; begin < end; ++I)
476 #pragma omp teams distribute parallel for simd
477 // expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
478 for (GoodIter I = begin; !I; ++I)
481 #pragma omp teams distribute parallel for simd
482 // expected-note@+2 {{loop step is expected to be negative due to this condition}}
483 // expected-error@+1 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
484 for (GoodIter I = begin; I >= end; I = I + 1)
487 #pragma omp teams distribute parallel for simd
488 for (GoodIter I = begin; I >= end; I = I - 1)
491 #pragma omp teams distribute parallel for simd
492 // expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'I'}}
493 for (GoodIter I = begin; I >= end; I = -I)
496 #pragma omp teams distribute parallel for simd
497 // expected-note@+2 {{loop step is expected to be negative due to this condition}}
498 // expected-error@+1 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
499 for (GoodIter I = begin; I >= end; I = 2 + I)
502 #pragma omp teams distribute parallel for simd
503 // expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'I'}}
504 for (GoodIter I = begin; I >= end; I = 2 - I)
507 #pragma omp teams distribute parallel for simd
508 // expected-error@+1 {{invalid operands to binary expression ('Iter0' and 'int')}}
509 for (Iter0 I = begin0; I < end0; ++I)
512 #pragma omp teams distribute parallel for simd
513 // Initializer is constructor without params.
514 // expected-error@+2 {{invalid operands to binary expression ('Iter0' and 'int')}}
515 // expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
516 for (Iter0 I; I < end0; ++I)
520 #pragma omp teams distribute parallel for simd
521 // expected-error@+2 {{invalid operands to binary expression ('Iter1' and 'Iter1')}}
522 // expected-error@+1 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
523 for (Iter1 I = begin1; I < end1; ++I)
526 #pragma omp teams distribute parallel for simd
527 // expected-note@+2 {{loop step is expected to be negative due to this condition}}
528 // expected-error@+1 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
529 for (Iter1 I = begin1; I >= end1; ++I)
532 #pragma omp teams distribute parallel for simd
533 // expected-error@+4 {{invalid operands to binary expression ('Iter1' and 'float')}}
534 // expected-error@+3 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
535 // Initializer is constructor with all default params.
536 // expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
537 for (Iter1 I; I < end1; ++I) {
542 template <typename IT, int ST>
545 int dotest_lt(IT begin, IT end) {
547 #pragma omp teams distribute parallel for simd
548 // expected-note@+2 {{loop step is expected to be positive due to this condition}}
549 // expected-error@+1 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
550 for (IT I = begin; I < end; I = I + ST) {
554 #pragma omp teams distribute parallel for simd
555 // expected-note@+2 {{loop step is expected to be positive due to this condition}}
556 // expected-error@+1 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
557 for (IT I = begin; I <= end; I += ST) {
561 #pragma omp teams distribute parallel for simd
562 for (IT I = begin; I < end; ++I) {
571 template <typename IT, int ST = 0>
572 int dotest_gt(IT begin, IT end) {
574 #pragma omp teams distribute parallel for simd
575 // expected-note@+2 2 {{loop step is expected to be negative due to this condition}}
576 // expected-error@+1 2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
577 for (IT I = begin; I >= end; I = I + ST) {
581 #pragma omp teams distribute parallel for simd
582 // expected-note@+2 2 {{loop step is expected to be negative due to this condition}}
583 // expected-error@+1 2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
584 for (IT I = begin; I >= end; I += ST) {
589 #pragma omp teams distribute parallel for simd
590 // expected-note@+2 {{loop step is expected to be negative due to this condition}}
591 // expected-error@+1 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
592 for (IT I = begin; I >= end; ++I) {
597 #pragma omp teams distribute parallel for simd
598 for (IT I = begin; I < end; I += TC<int, ST>::step()) {
603 void test_with_template() {
605 TC<GoodIter, 100> t1;
606 TC<GoodIter, -100> t2;
607 t1.dotest_lt(begin, end);
608 t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
609 dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
610 dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
613 void test_loop_break() {
615 float a[N], b[N], c[N];
617 #pragma omp teams distribute parallel for simd
618 for (int i = 0; i < 10; i++) {
620 for (int j = 0; j < 10; ++j) {
622 break; // OK in nested loop
632 break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
635 break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
639 #pragma omp teams distribute parallel for simd
640 for (int i = 0; i < 10; i++) {
641 for (int j = 0; j < 10; j++) {
652 void test_loop_eh() {
654 float a[N], b[N], c[N];
656 #pragma omp teams distribute parallel for simd
657 for (int i = 0; i < 10; i++) {
659 try { // expected-error {{'try' statement cannot be used in OpenMP simd region}}
660 for (int j = 0; j < 10; ++j) {
662 throw a[i]; // expected-error {{'throw' statement cannot be used in OpenMP simd region}}
664 throw a[i]; // expected-error {{'throw' statement cannot be used in OpenMP simd region}}
667 throw a[i]; // expected-error {{'throw' statement cannot be used in OpenMP simd region}}
668 return; // expected-error {{cannot return from OpenMP region}}
677 for (int j = 0; j < 10; j++) {
679 throw c[i]; // expected-error {{'throw' statement cannot be used in OpenMP simd region}}
686 #pragma omp teams distribute parallel for simd
687 for (int i = 0; i < 10; ++i) {
689 void g() { throw 0; }
694 void test_loop_firstprivate_lastprivate() {
697 #pragma omp teams distribute parallel for simd lastprivate(s) firstprivate(s)
698 for (int i = 0; i < 16; ++i)
702 void test_ordered() {
704 #pragma omp teams distribute parallel for simd ordered // expected-error {{unexpected OpenMP clause 'ordered' in directive '#pragma omp teams distribute parallel for simd'}}
705 for (int i = 0; i < 16; ++i)
711 // expected-error@+1 2 {{unexpected OpenMP clause 'nowait' in directive '#pragma omp teams distribute parallel for simd'}}
712 #pragma omp teams distribute parallel for simd nowait nowait // expected-error {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'nowait' clause}}
713 for (int i = 0; i < 16; ++i)