1 // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
2 // RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
4 // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
5 // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
13 S(const S
&s
) : a(s
.a
) {}
17 // expected-note@+1 {{defined as threadprivate or thread local}}
18 #pragma omp threadprivate(sii)
21 int test_iteration_spaces() {
23 float a
[N
], b
[N
], c
[N
];
27 #pragma omp parallel for
28 for (int i
= 0; i
< 10; i
+= 1) {
31 #pragma omp parallel for
32 for (char i
= 0; i
< 10; i
++) {
35 #pragma omp parallel for
36 for (char i
= 0; i
< 10; i
+= '\1') {
39 #pragma omp parallel for
40 for (long long i
= 0; i
< 10; i
++) {
43 // expected-error@+2 {{expression must have integral or unscoped enumeration type, not 'double'}}
44 #pragma omp parallel for
45 for (long long i
= 0; i
< 10; i
+= 1.5) {
48 #pragma omp parallel for
49 for (long long i
= 0; i
< 'z'; i
+= 1u) {
52 // expected-error@+2 {{variable must be of integer or random access iterator type}}
53 #pragma omp parallel for
54 for (float fi
= 0; fi
< 10.0; fi
++) {
55 c
[(int)fi
] = a
[(int)fi
] + b
[(int)fi
];
57 // expected-error@+2 {{variable must be of integer or random access iterator type}}
58 #pragma omp parallel for
59 for (double fi
= 0; fi
< 10.0; fi
++) {
60 c
[(int)fi
] = a
[(int)fi
] + b
[(int)fi
];
62 // expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
63 #pragma omp parallel for
64 for (int &ref
= ii
; ref
< 10; ref
++) {
66 // expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
67 #pragma omp parallel for
68 for (int i
; i
< 10; i
++)
71 // expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
72 #pragma omp parallel for
73 for (int i
= 0, j
= 0; i
< 10; ++i
)
76 // expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
77 #pragma omp parallel for
81 // expected-warning@+3 {{expression result unused}}
82 // expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
83 #pragma omp parallel for
84 for (ii
+ 1; ii
< 10; ++ii
)
87 // expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
88 #pragma omp parallel for
89 for (c
[ii
] = 0; ii
< 10; ++ii
)
92 // Ok to skip parenthesises.
93 #pragma omp parallel for
94 for (((ii
)) = 0; ii
< 10; ++ii
)
97 // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
98 #pragma omp parallel for
99 for (int i
= 0; i
; i
++)
102 // omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
103 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
104 #pragma omp parallel for
105 for (int i
= 0; jj
< kk
; ii
++)
108 // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
109 #pragma omp parallel for
110 for (int i
= 0; !!i
; i
++)
113 // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
114 #pragma omp parallel for
115 for (int i
= 0; i
!= 1; i
++)
118 // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
119 #pragma omp parallel for
120 for (int i
= 0;; i
++)
124 #pragma omp parallel for
125 for (int i
= 11; i
> 10; i
--)
129 #pragma omp parallel for
130 for (int i
= 0; i
< 10; ++i
)
134 #pragma omp parallel for
135 for (ii
= 0; ii
< 10; ++ii
)
138 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
139 #pragma omp parallel for
140 for (ii
= 0; ii
< 10; ++jj
)
143 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
144 #pragma omp parallel for
145 for (ii
= 0; ii
< 10; ++++ii
)
148 // Ok but undefined behavior (in general, cannot check that incr
149 // is really loop-invariant).
150 #pragma omp parallel for
151 for (ii
= 0; ii
< 10; ii
= ii
+ ii
)
154 // expected-error@+2 {{expression must have integral or unscoped enumeration type, not 'float'}}
155 #pragma omp parallel for
156 for (ii
= 0; ii
< 10; ii
= ii
+ 1.0f
)
159 // Ok - step was converted to integer type.
160 #pragma omp parallel for
161 for (ii
= 0; ii
< 10; ii
= ii
+ (int)1.1f
)
164 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
165 #pragma omp parallel for
166 for (ii
= 0; ii
< 10; jj
= ii
+ 2)
169 // expected-warning@+3 {{relational comparison result unused}}
170 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
171 #pragma omp parallel for
172 for (ii
= 0; ii
<10; jj
> kk
+ 2)
175 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
176 #pragma omp parallel for
177 for (ii
= 0; ii
< 10;)
180 // expected-warning@+3 {{expression result unused}}
181 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
182 #pragma omp parallel for
183 for (ii
= 0; ii
< 10; !ii
)
186 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
187 #pragma omp parallel for
188 for (ii
= 0; ii
< 10; ii
? ++ii
: ++jj
)
191 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
192 #pragma omp parallel for
193 for (ii
= 0; ii
< 10; ii
= ii
< 10)
196 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
197 // expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
198 #pragma omp parallel for
199 for (ii
= 0; ii
< 10; ii
= ii
+ 0)
202 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
203 // expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
204 #pragma omp parallel for
205 for (ii
= 0; ii
< 10; ii
= ii
+ (int)(0.8 - 0.45))
208 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
209 // expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
210 #pragma omp parallel for
211 for (ii
= 0; (ii
) < 10; ii
-= 25)
214 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
215 // expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
216 #pragma omp parallel for
217 for (ii
= 0; (ii
< 10); ii
-= 0)
220 // expected-note@+3 {{loop step is expected to be negative due to this condition}}
221 // expected-error@+2 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
222 #pragma omp parallel for
223 for (ii
= 0; ii
> 10; (ii
+= 0))
226 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
227 // expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
228 #pragma omp parallel for
229 for (ii
= 0; ii
< 10; (ii
) = (1 - 1) + (ii
))
232 // expected-note@+3 {{loop step is expected to be negative due to this condition}}
233 // expected-error@+2 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
234 #pragma omp parallel for
235 for ((ii
= 0); ii
> 10; (ii
-= 0))
238 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
239 // expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
240 #pragma omp parallel for
241 for (ii
= 0; (ii
< 10); (ii
-= 0))
244 // expected-note@+2 {{defined as firstprivate}}
245 // expected-error@+2 {{loop iteration variable in the associated loop of 'omp parallel for' directive may not be firstprivate, predetermined as private}}
246 #pragma omp parallel for firstprivate(ii)
247 for (ii
= 0; ii
< 10; ii
++)
250 // expected-note@+2 {{defined as linear}}
251 // expected-error@+2 {{loop iteration variable in the associated loop of 'omp parallel for' directive may not be linear, predetermined as private}}
252 #pragma omp parallel for linear(ii)
253 for (ii
= 0; ii
< 10; ii
++)
256 #pragma omp parallel for private(ii)
257 for (ii
= 0; ii
< 10; ii
++)
260 #pragma omp parallel for lastprivate(ii)
261 for (ii
= 0; ii
< 10; ii
++)
265 // expected-error@+2 {{loop iteration variable in the associated loop of 'omp parallel for' directive may not be threadprivate or thread local, predetermined as private}}
266 #pragma omp parallel for
267 for (sii
= 0; sii
< 10; sii
+= 1)
272 #pragma omp parallel for
273 for (globalii
= 0; globalii
< 10; globalii
+= 1)
274 c
[globalii
] = a
[globalii
];
278 #pragma omp parallel for collapse(2)
279 for (ii
= 0; ii
< 10; ii
+= 1)
280 for (globalii
= 0; globalii
< 10; globalii
+= 1)
281 c
[globalii
] += a
[globalii
] + ii
;
284 // omp4-error@+2 {{statement after '#pragma omp parallel for' must be a for loop}}
285 #pragma omp parallel for
286 for (auto &item
: a
) {
290 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
291 // expected-error@+2 {{increment expression must cause 'i' to increase on each iteration of OpenMP for loop}}
292 #pragma omp parallel for
293 for (unsigned i
= 9; i
< 10; i
--) {
297 int(*lb
)[4] = nullptr;
298 #pragma omp parallel for
299 for (int(*p
)[4] = lb
; p
< lb
+ 8; ++p
) {
302 // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
303 #pragma omp parallel for
304 for (int a
{0}; a
< 10; ++a
) {
310 // Iterators allowed in openmp for-loops.
312 struct random_access_iterator_tag
{};
313 template <class Iter
>
314 struct iterator_traits
{
315 typedef typename
Iter::difference_type difference_type
;
316 typedef typename
Iter::iterator_category iterator_category
;
318 template <class Iter
>
319 typename iterator_traits
<Iter
>::difference_type
320 distance(Iter first
, Iter last
) { return first
- last
; }
325 Iter0(const Iter0
&) {}
326 Iter0
operator++() { return *this; }
327 Iter0
operator--() { return *this; }
328 bool operator<(Iter0 a
) { return true; }
330 // expected-note@+2 {{candidate function not viable: no known conversion from 'GoodIter' to 'Iter0' for 1st argument}}
331 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'Iter0' for 1st argument}}
332 int operator-(Iter0 a
, Iter0 b
) { return 0; }
335 Iter1(float f
= 0.0f
, double d
= 0.0) {}
336 Iter1(const Iter1
&) {}
337 Iter1
operator++() { return *this; }
338 Iter1
operator--() { return *this; }
339 bool operator<(Iter1 a
) { return true; }
340 bool operator>=(Iter1 a
) { return false; }
345 GoodIter(const GoodIter
&) {}
346 GoodIter(int fst
, int snd
) {}
347 GoodIter
&operator=(const GoodIter
&that
) { return *this; }
348 GoodIter
&operator=(const Iter0
&that
) { return *this; }
349 GoodIter
&operator+=(int x
) { return *this; }
350 GoodIter
&operator-=(int x
) { return *this; }
351 explicit GoodIter(void *) {}
352 GoodIter
operator++() { return *this; }
353 GoodIter
operator--() { return *this; }
354 bool operator!() { return true; }
355 bool operator<(GoodIter a
) { return true; }
356 bool operator<=(GoodIter a
) { return true; }
357 bool operator>=(GoodIter a
) { return false; }
358 typedef int difference_type
;
359 typedef std::random_access_iterator_tag iterator_category
;
361 // expected-note@+2 {{candidate function not viable: no known conversion from 'const Iter0' to 'GoodIter' for 2nd argument}}
362 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'GoodIter' for 1st argument}}
363 int operator-(GoodIter a
, GoodIter b
) { return 0; }
364 // expected-note@+1 3 {{candidate function not viable: requires single argument 'a', but 2 arguments were provided}}
365 GoodIter
operator-(GoodIter a
) { return a
; }
366 // expected-note@+2 {{candidate function not viable: no known conversion from 'const Iter0' to 'int' for 2nd argument}}
367 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'GoodIter' for 1st argument}}
368 GoodIter
operator-(GoodIter a
, int v
) { return GoodIter(); }
369 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter0' to 'GoodIter' for 1st argument}}
370 GoodIter
operator+(GoodIter a
, int v
) { return GoodIter(); }
371 // expected-note@+2 {{candidate function not viable: no known conversion from 'GoodIter' to 'int' for 1st argument}}
372 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'int' for 1st argument}}
373 GoodIter
operator-(int v
, GoodIter a
) { return GoodIter(); }
374 // expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter0' to 'int' for 1st argument}}
375 GoodIter
operator+(int v
, GoodIter a
) { return GoodIter(); }
377 int test_with_random_access_iterator() {
380 #pragma omp parallel for
381 for (GoodIter I
= begin
; I
< end
; ++I
)
383 // expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
384 #pragma omp parallel for
385 for (GoodIter
&I
= begin
; I
< end
; ++I
)
387 #pragma omp parallel for
388 for (GoodIter I
= begin
; I
>= end
; --I
)
390 // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
391 #pragma omp parallel for
392 for (GoodIter
I(begin
); I
< end
; ++I
)
394 // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
395 #pragma omp parallel for
396 for (GoodIter
I(nullptr); I
< end
; ++I
)
398 // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
399 #pragma omp parallel for
400 for (GoodIter
I(0); I
< end
; ++I
)
402 // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
403 #pragma omp parallel for
404 for (GoodIter
I(1, 2); I
< end
; ++I
)
406 #pragma omp parallel for
407 for (begin
= GoodIter(0); begin
< end
; ++begin
)
409 // expected-error@+3 {{invalid operands to binary expression ('GoodIter' and 'const Iter0')}}
410 // expected-error@+2 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
411 #pragma omp parallel for
412 for (begin
= begin0
; begin
< end
; ++begin
)
414 // expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
415 #pragma omp parallel for
416 for (++begin
; begin
< end
; ++begin
)
418 #pragma omp parallel for
419 for (begin
= end
; begin
< end
; ++begin
)
421 // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
422 #pragma omp parallel for
423 for (GoodIter I
= begin
; I
- I
; ++I
)
425 // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
426 #pragma omp parallel for
427 for (GoodIter I
= begin
; begin
< end
; ++I
)
429 // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
430 #pragma omp parallel for
431 for (GoodIter I
= begin
; !I
; ++I
)
433 // expected-note@+3 {{loop step is expected to be negative due to this condition}}
434 // expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
435 #pragma omp parallel for
436 for (GoodIter I
= begin
; I
>= end
; I
= I
+ 1)
438 #pragma omp parallel for
439 for (GoodIter I
= begin
; I
>= end
; I
= I
- 1)
441 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'I'}}
442 #pragma omp parallel for
443 for (GoodIter I
= begin
; I
>= end
; I
= -I
)
445 // expected-note@+3 {{loop step is expected to be negative due to this condition}}
446 // expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
447 #pragma omp parallel for
448 for (GoodIter I
= begin
; I
>= end
; I
= 2 + I
)
450 // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'I'}}
451 #pragma omp parallel for
452 for (GoodIter I
= begin
; I
>= end
; I
= 2 - I
)
454 // expected-error@+2 {{invalid operands to binary expression ('Iter0' and 'int')}}
455 #pragma omp parallel for
456 for (Iter0 I
= begin0
; I
< end0
; ++I
)
458 // Initializer is constructor without params.
459 // expected-error@+3 {{invalid operands to binary expression ('Iter0' and 'int')}}
460 // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
461 #pragma omp parallel for
462 for (Iter0 I
; I
< end0
; ++I
)
465 // expected-error@+3 {{invalid operands to binary expression ('Iter1' and 'Iter1')}}
466 // expected-error@+2 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
467 #pragma omp parallel for
468 for (Iter1 I
= begin1
; I
< end1
; ++I
)
470 // expected-note@+3 {{loop step is expected to be negative due to this condition}}
471 // expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
472 #pragma omp parallel for
473 for (Iter1 I
= begin1
; I
>= end1
; ++I
)
475 // expected-error@+5 {{invalid operands to binary expression ('Iter1' and 'float')}}
476 // expected-error@+4 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
477 // Initializer is constructor with all default params.
478 // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
479 #pragma omp parallel for
480 for (Iter1 I
; I
< end1
; ++I
) {
485 template <typename IT
, int ST
>
488 int dotest_lt(IT begin
, IT end
) {
489 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
490 // expected-error@+2 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
491 #pragma omp parallel for
492 for (IT I
= begin
; I
< end
; I
= I
+ ST
) {
495 // expected-note@+3 {{loop step is expected to be positive due to this condition}}
496 // expected-error@+2 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
497 #pragma omp parallel for
498 for (IT I
= begin
; I
<= end
; I
+= ST
) {
501 #pragma omp parallel for
502 for (IT I
= begin
; I
< end
; ++I
) {
511 template <typename IT
, int ST
= 0>
512 int dotest_gt(IT begin
, IT end
) {
513 // expected-note@+3 2 {{loop step is expected to be negative due to this condition}}
514 // expected-error@+2 2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
515 #pragma omp parallel for
516 for (IT I
= begin
; I
>= end
; I
= I
+ ST
) {
519 // expected-note@+3 2 {{loop step is expected to be negative due to this condition}}
520 // expected-error@+2 2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
521 #pragma omp parallel for
522 for (IT I
= begin
; I
>= end
; I
+= ST
) {
526 // expected-note@+3 {{loop step is expected to be negative due to this condition}}
527 // expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
528 #pragma omp parallel for
529 for (IT I
= begin
; I
>= end
; ++I
) {
533 #pragma omp parallel for
534 for (IT I
= begin
; I
< end
; I
+= TC
<int, ST
>::step()) {
539 void test_with_template() {
541 TC
<GoodIter
, 100> t1
;
542 TC
<GoodIter
, -100> t2
;
543 t1
.dotest_lt(begin
, end
);
544 t2
.dotest_lt(begin
, end
); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
545 dotest_gt(begin
, end
); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
546 dotest_gt
<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
549 void test_loop_break() {
551 float a
[N
], b
[N
], c
[N
];
552 #pragma omp parallel for
553 for (int i
= 0; i
< 10; i
++) {
555 for (int j
= 0; j
< 10; ++j
) {
557 break; // OK in nested loop
567 break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
570 break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
573 #pragma omp parallel for
574 for (int i
= 0; i
< 10; i
++) {
575 for (int j
= 0; j
< 10; j
++) {
586 void test_loop_eh() {
588 float a
[N
], b
[N
], c
[N
];
589 #pragma omp parallel for
590 for (int i
= 0; i
< 10; i
++) {
593 for (int j
= 0; j
< 10; ++j
) {
601 return; // expected-error {{cannot return from OpenMP region}}
610 for (int j
= 0; j
< 10; j
++) {
618 #pragma omp parallel for
619 for (int i
= 0; i
< 10; ++i
) {
621 void g() { throw 0; }
626 void test_loop_firstprivate_lastprivate() {
628 #pragma omp parallel for lastprivate(s) firstprivate(s)
629 for (int i
= 0; i
< 16; ++i
)