1 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -verify %s
3 void func( double *A
, int N
, int M
, int NB
) {
7 int lnb
= ((N
-1)/NB
)*NB
;
9 #pragma omp for collapse(2)
10 for (int jblk
= 0 ; jblk
< nblks
; jblk
++ ) {
11 int jb
= (jblk
== nblks
- 1 ? lnb
: NB
);
12 for (int jk
= 0; jk
< N
; jk
+=jb
) { // expected-error{{cannot use variable 'jb' in collapsed imperfectly-nested loop increment statement}}
16 #pragma omp for collapse(2)
17 for (int a
= 0; a
< N
; a
++) {
18 for (int b
= 0; b
< M
; b
++) {
19 int cx
= a
+b
< NB
? a
: b
;
20 for (int c
= 0; c
< cx
; c
++) {
25 #pragma omp for collapse(3)
26 for (int a
= 0; a
< N
; a
++) {
27 for (int b
= 0; b
< M
; b
++) {
28 int cx
= a
+b
< NB
? a
: b
;
29 for (int c
= 0; c
< cx
; c
++) { // expected-error{{cannot use variable 'cx' in collapsed imperfectly-nested loop condition statement}}
38 func (arr
, 16, 16, 16);