1 // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -std=c++17 -fopenmp -fsyntax-only -Wuninitialized -verify %s
5 // expected-error@+1 {{expected '('}}
9 // expected-error@+2 {{expected expression}}
10 // expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
11 #pragma omp tile sizes(
14 // expected-error@+1 {{expected expression}}
15 #pragma omp tile sizes()
18 // expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
19 #pragma omp tile sizes(5
20 for (int i
= 0; i
< 7; ++i
);
22 // expected-error@+2 {{expected expression}}
23 // expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
24 #pragma omp tile sizes(5,
27 // expected-error@+1 {{expected expression}}
28 #pragma omp tile sizes(5,)
31 // expected-error@+2 {{expected expression}}
32 // expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
33 #pragma omp tile sizes(5+
36 // expected-error@+1 {{expected expression}}
37 #pragma omp tile sizes(5+)
40 // expected-error@+1 {{expected expression}}
41 #pragma omp tile sizes(for)
44 // expected-error@+1 {{argument to 'sizes' clause must be a strictly positive integer value}}
45 #pragma omp tile sizes(0)
48 // expected-error@+4 {{expression is not an integral constant expression}}
49 // expected-note@+3 {{read of non-const variable 'a' is not allowed in a constant expression}}
50 // expected-note@+1 {{declared here}}
52 #pragma omp tile sizes(a)
55 // expected-warning@+2 {{extra tokens at the end of '#pragma omp tile' are ignored}}
56 // expected-error@+1 {{directive '#pragma omp tile' requires the 'sizes' clause}}
60 // expected-error@+1 {{directive '#pragma omp tile' cannot contain more than one 'sizes' clause}}
61 #pragma omp tile sizes(5) sizes(5)
62 for (int i
= 0; i
< 7; ++i
)
65 // expected-error@+1 {{unexpected OpenMP clause 'collapse' in directive '#pragma omp tile'}}
66 #pragma omp tile sizes(5) collapse(2)
67 for (int i
= 0; i
< 7; ++i
)
71 // expected-error@+2 {{expected statement}}
72 #pragma omp tile sizes(5)
75 // expected-error@+2 {{statement after '#pragma omp tile' must be a for loop}}
76 #pragma omp tile sizes(5)
79 // expected-error@+3 {{statement after '#pragma omp tile' must be a for loop}}
80 #pragma omp tile sizes(5,5)
81 for (int i
= 0; i
< 7; ++i
)
84 // expected-error@+2 {{statement after '#pragma omp tile' must be a for loop}}
85 #pragma omp tile sizes(5,5)
86 for (int i
= 0; i
< 7; ++i
) {
88 for (int j
= 0; j
< 7; ++j
)
92 // expected-error@+3 {{expected loop invariant expression}}
93 #pragma omp tile sizes(5,5)
94 for (int i
= 0; i
< 7; ++i
)
95 for (int j
= i
; j
< 7; ++j
)
98 // expected-error@+3 {{expected loop invariant expression}}
99 #pragma omp tile sizes(5,5)
100 for (int i
= 0; i
< 7; ++i
)
101 for (int j
= 0; j
< i
; ++j
)
104 // expected-error@+3 {{expected loop invariant expression}}
105 #pragma omp tile sizes(5,5)
106 for (int i
= 0; i
< 7; ++i
)
107 for (int j
= 0; j
< i
; ++j
)
110 // expected-error@+5 {{expected 3 for loops after '#pragma omp for', but found only 2}}
111 // expected-note@+1 {{as specified in 'collapse' clause}}
112 #pragma omp for collapse(3)
113 #pragma omp tile sizes(5)
114 for (int i
= 0; i
< 7; ++i
)
117 // expected-error@+2 {{statement after '#pragma omp tile' must be a for loop}}
118 #pragma omp tile sizes(5)
120 for (int i
= 0; i
< 7; ++i
)
123 // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
124 #pragma omp tile sizes(5)
125 for (int i
= 0; i
/3<7; ++i
)