1 // RUN: %clang_cc1 -std=c++11 -verify -fopenmp %s -Wuninitialized
3 // RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
15 const int da
[5] = { 0 };
27 #pragma omp target parallel for is_device_ptr // expected-error {{expected '(' after 'is_device_ptr'}}
28 for (int ii
=0; ii
<10; ii
++)
30 #pragma omp target parallel for is_device_ptr( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}}
31 for (int ii
=0; ii
<10; ii
++)
33 #pragma omp target parallel for is_device_ptr() // expected-error {{expected expression}}
34 for (int ii
=0; ii
<10; ii
++)
36 #pragma omp target parallel for is_device_ptr(alloc) // expected-error {{use of undeclared identifier 'alloc'}}
37 for (int ii
=0; ii
<10; ii
++)
39 #pragma omp target parallel for is_device_ptr(arg // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
40 for (int ii
=0; ii
<10; ii
++)
42 #pragma omp target parallel for is_device_ptr(i) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
43 for (int ii
=0; ii
<10; ii
++)
45 #pragma omp target parallel for is_device_ptr(j) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
46 for (int ii
=0; ii
<10; ii
++)
48 #pragma omp target parallel for is_device_ptr(k) // OK
49 for (int ii
=0; ii
<10; ii
++)
51 #pragma omp target parallel for is_device_ptr(z) // OK
52 for (int ii
=0; ii
<10; ii
++)
54 #pragma omp target parallel for is_device_ptr(aa) // OK
55 for (int ii
=0; ii
<10; ii
++)
57 #pragma omp target parallel for is_device_ptr(raa) // OK
58 for (int ii
=0; ii
<10; ii
++)
60 #pragma omp target parallel for is_device_ptr(e) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
61 for (int ii
=0; ii
<10; ii
++)
63 #pragma omp target parallel for is_device_ptr(g) // OK
64 for (int ii
=0; ii
<10; ii
++)
66 #pragma omp target parallel for is_device_ptr(rg) // OK
67 for (int ii
=0; ii
<10; ii
++)
69 #pragma omp target parallel for is_device_ptr(k,i,j) // expected-error2 {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
70 for (int ii
=0; ii
<10; ii
++)
72 #pragma omp target parallel for is_device_ptr(d) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
73 for (int ii
=0; ii
<10; ii
++)
75 #pragma omp target parallel for is_device_ptr(da) // OK
76 for (int ii
=0; ii
<10; ii
++)
78 #pragma omp target parallel for map(ps) is_device_ptr(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
79 for (int ii
=0; ii
<10; ii
++)
81 #pragma omp target parallel for is_device_ptr(ps) map(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
82 for (int ii
=0; ii
<10; ii
++)
84 #pragma omp target parallel for map(ps->a) is_device_ptr(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
85 for (int ii
=0; ii
<10; ii
++)
87 #pragma omp target parallel for is_device_ptr(ps) map(ps->a) // expected-error{{pointer cannot be mapped along with a section derived from itself}} expected-note{{used here}}
88 for (int ii
=0; ii
<10; ii
++)
90 #pragma omp target parallel for firstprivate(ps) is_device_ptr(ps) // expected-error{{firstprivate variable cannot be in a is_device_ptr clause in '#pragma omp target parallel for' directive}} expected-note{{defined as firstprivate}}
91 for (int ii
=0; ii
<10; ii
++)
93 #pragma omp target parallel for private(ps) is_device_ptr(ps) // expected-error{{private variable cannot be in a is_device_ptr clause in '#pragma omp target parallel for' directive}} expected-note{{defined as private}}
94 for (int ii
=0; ii
<10; ii
++)
122 SC(SB
*&_RPtrS
) : RPtrS(_RPtrS
) {}
136 S2(S2
&s2
):a(s2
.a
) { }
138 static const float S2sc
;
140 const float S2::S2sc
= 0;
147 S3(S3
&s3
):a(s3
.a
) { }
162 S5(const S5
&s5
):a(s5
.a
) { }
168 #pragma omp threadprivate(h)
174 template <typename T
, int I
>
177 const T da
[5] = { 0 };
188 #pragma omp target parallel for is_device_ptr // expected-error {{expected '(' after 'is_device_ptr'}}
189 for (int kk
=0; kk
<20; kk
++)
191 #pragma omp target parallel for is_device_ptr( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}}
192 for (int kk
=0; kk
<20; kk
++)
194 #pragma omp target parallel for is_device_ptr() // expected-error {{expected expression}}
195 for (int kk
=0; kk
<20; kk
++)
197 #pragma omp target parallel for is_device_ptr(alloc) // expected-error {{use of undeclared identifier 'alloc'}}
198 for (int kk
=0; kk
<20; kk
++)
200 #pragma omp target parallel for is_device_ptr(argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
201 for (int kk
=0; kk
<20; kk
++)
203 #pragma omp target parallel for is_device_ptr(i) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
204 for (int kk
=0; kk
<20; kk
++)
206 #pragma omp target parallel for is_device_ptr(j) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
207 for (int kk
=0; kk
<20; kk
++)
209 #pragma omp target parallel for is_device_ptr(k) // OK
210 for (int kk
=0; kk
<20; kk
++)
212 #pragma omp target parallel for is_device_ptr(z) // OK
213 for (int kk
=0; kk
<20; kk
++)
215 #pragma omp target parallel for is_device_ptr(aa) // OK
216 for (int kk
=0; kk
<20; kk
++)
218 #pragma omp target parallel for is_device_ptr(raa) // OK
219 for (int kk
=0; kk
<20; kk
++)
221 #pragma omp target parallel for is_device_ptr(e) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
222 for (int kk
=0; kk
<20; kk
++)
224 #pragma omp target parallel for is_device_ptr(g) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
225 for (int kk
=0; kk
<20; kk
++)
227 #pragma omp target parallel for is_device_ptr(h) // OK
228 for (int kk
=0; kk
<20; kk
++)
230 #pragma omp target parallel for is_device_ptr(rh) // OK
231 for (int kk
=0; kk
<20; kk
++)
233 #pragma omp target parallel for is_device_ptr(k,i,j) // expected-error2 {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
234 for (int kk
=0; kk
<20; kk
++)
236 #pragma omp target parallel for is_device_ptr(d) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
237 for (int kk
=0; kk
<20; kk
++)
239 #pragma omp target parallel for is_device_ptr(da) // OK
240 for (int kk
=0; kk
<20; kk
++)
245 int main(int argc
, char **argv
) {
247 const int da
[5] = { 0 };
258 #pragma omp target parallel for is_device_ptr // expected-error {{expected '(' after 'is_device_ptr'}}
259 for (int kk
=0; kk
<20; kk
++)
261 #pragma omp target parallel for is_device_ptr( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}}
262 for (int kk
=0; kk
<20; kk
++)
264 #pragma omp target parallel for is_device_ptr() // expected-error {{expected expression}}
265 for (int kk
=0; kk
<20; kk
++)
267 #pragma omp target parallel for is_device_ptr(alloc) // expected-error {{use of undeclared identifier 'alloc'}}
268 for (int kk
=0; kk
<20; kk
++)
270 #pragma omp target parallel for is_device_ptr(argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
271 for (int kk
=0; kk
<20; kk
++)
273 #pragma omp target parallel for is_device_ptr(i) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
274 for (int kk
=0; kk
<20; kk
++)
276 #pragma omp target parallel for is_device_ptr(j) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
277 for (int kk
=0; kk
<20; kk
++)
279 #pragma omp target parallel for is_device_ptr(k) // OK
280 for (int kk
=0; kk
<20; kk
++)
282 #pragma omp target parallel for is_device_ptr(z) // OK
283 for (int kk
=0; kk
<20; kk
++)
285 #pragma omp target parallel for is_device_ptr(aa) // OK
286 for (int kk
=0; kk
<20; kk
++)
288 #pragma omp target parallel for is_device_ptr(raa) // OK
289 for (int kk
=0; kk
<20; kk
++)
291 #pragma omp target parallel for is_device_ptr(e) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
292 for (int kk
=0; kk
<20; kk
++)
294 #pragma omp target parallel for is_device_ptr(g) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
295 for (int kk
=0; kk
<20; kk
++)
297 #pragma omp target parallel for is_device_ptr(h) // OK
298 for (int kk
=0; kk
<20; kk
++)
300 #pragma omp target parallel for is_device_ptr(rh) // OK
301 for (int kk
=0; kk
<20; kk
++)
303 #pragma omp target parallel for is_device_ptr(k,i,j) // expected-error2 {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
304 for (int kk
=0; kk
<20; kk
++)
306 #pragma omp target parallel for is_device_ptr(d) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
307 for (int kk
=0; kk
<20; kk
++)
309 #pragma omp target parallel for is_device_ptr(da) // OK
310 for (int kk
=0; kk
<20; kk
++)
312 return tmain
<int, 3>(argc
); // expected-note {{in instantiation of function template specialization 'tmain<int, 3>' requested here}}