1 // RUN: %clang_cc1 -std=c++11 -verify=expected,omp4 -fopenmp -fopenmp-version=45 %s -Wuninitialized
2 // RUN: %clang_cc1 -std=c++11 -verify -fopenmp %s -Wuninitialized
4 // RUN: %clang_cc1 -std=c++11 -verify=expected,omp4 -fopenmp-simd -fopenmp-version=45 %s -Wuninitialized
5 // RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
13 const int da
[5] = { 0 };
24 #pragma omp target teams distribute simd is_device_ptr // expected-error {{expected '(' after 'is_device_ptr'}}
25 for (int i
=0; i
<100; i
++)
27 #pragma omp target teams distribute simd is_device_ptr( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}}
28 for (int i
=0; i
<100; i
++)
30 #pragma omp target teams distribute simd is_device_ptr() // expected-error {{expected expression}}
31 for (int i
=0; i
<100; i
++)
33 #pragma omp target teams distribute simd is_device_ptr(alloc) // expected-error {{use of undeclared identifier 'alloc'}}
34 for (int i
=0; i
<100; i
++)
36 #pragma omp target teams distribute simd 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'}}
37 for (int i
=0; i
<100; i
++)
39 #pragma omp target teams distribute simd is_device_ptr(i) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
40 for (int i
=0; i
<100; i
++)
42 #pragma omp target teams distribute simd is_device_ptr(j) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
43 for (int i
=0; i
<100; i
++)
45 #pragma omp target teams distribute simd is_device_ptr(k) // OK
46 for (int i
=0; i
<100; i
++)
48 #pragma omp target teams distribute simd is_device_ptr(z) // OK
49 for (int i
=0; i
<100; i
++)
51 #pragma omp target teams distribute simd is_device_ptr(aa) // OK
52 for (int i
=0; i
<100; i
++)
54 #pragma omp target teams distribute simd is_device_ptr(raa) // OK
55 for (int i
=0; i
<100; i
++)
57 #pragma omp target teams distribute simd is_device_ptr(e) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
58 for (int i
=0; i
<100; i
++)
60 #pragma omp target teams distribute simd is_device_ptr(g) // OK
61 for (int i
=0; i
<100; i
++)
63 #pragma omp target teams distribute simd is_device_ptr(rg) // OK
64 for (int i
=0; i
<100; i
++)
66 #pragma omp target teams distribute simd is_device_ptr(k,i,j) // expected-error2 {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
67 for (int i
=0; i
<100; i
++)
69 #pragma omp target teams distribute simd is_device_ptr(d) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
70 for (int i
=0; i
<100; i
++)
72 #pragma omp target teams distribute simd is_device_ptr(da) // OK
73 for (int i
=0; i
<100; i
++)
100 SC(SB
*&_RPtrS
) : RPtrS(_RPtrS
) {}
114 S2(S2
&s2
):a(s2
.a
) { }
116 static const float S2sc
;
118 const float S2::S2sc
= 0;
125 S3(S3
&s3
):a(s3
.a
) { }
140 S5(const S5
&s5
):a(s5
.a
) { }
146 #pragma omp threadprivate(h)
152 template <typename T
, int I
>
155 const T da
[5] = { 0 };
167 #pragma omp target teams distribute simd is_device_ptr // expected-error {{expected '(' after 'is_device_ptr'}}
168 for (int i
=0; i
<100; i
++)
170 #pragma omp target teams distribute simd is_device_ptr( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}}
171 for (int i
=0; i
<100; i
++)
173 #pragma omp target teams distribute simd is_device_ptr() // expected-error {{expected expression}}
174 for (int i
=0; i
<100; i
++)
176 #pragma omp target teams distribute simd is_device_ptr(alloc) // expected-error {{use of undeclared identifier 'alloc'}}
177 for (int i
=0; i
<100; i
++)
179 #pragma omp target teams distribute simd 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'}}
180 for (int i
=0; i
<100; i
++)
182 #pragma omp target teams distribute simd is_device_ptr(i) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
183 for (int i
=0; i
<100; i
++)
185 #pragma omp target teams distribute simd is_device_ptr(j) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
186 for (int i
=0; i
<100; i
++)
188 #pragma omp target teams distribute simd is_device_ptr(k) // OK
189 for (int i
=0; i
<100; i
++)
191 #pragma omp target teams distribute simd is_device_ptr(z) // OK
192 for (int i
=0; i
<100; i
++)
194 #pragma omp target teams distribute simd is_device_ptr(aa) // OK
195 for (int i
=0; i
<100; i
++)
197 #pragma omp target teams distribute simd is_device_ptr(raa) // OK
198 for (int i
=0; i
<100; i
++)
200 #pragma omp target teams distribute simd is_device_ptr(e) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
201 for (int i
=0; i
<100; i
++)
203 #pragma omp target teams distribute simd is_device_ptr(g) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
204 for (int i
=0; i
<100; i
++)
206 #pragma omp target teams distribute simd is_device_ptr(h) // OK
207 for (int i
=0; i
<100; i
++)
209 #pragma omp target teams distribute simd is_device_ptr(rh) // OK
210 for (int i
=0; i
<100; i
++)
212 #pragma omp target teams distribute simd is_device_ptr(k,i,j) // expected-error2 {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
213 for (int i
=0; i
<100; i
++)
215 #pragma omp target teams distribute simd is_device_ptr(d) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
216 for (int i
=0; i
<100; i
++)
218 #pragma omp target teams distribute simd is_device_ptr(da) // OK
219 for (int i
=0; i
<100; i
++)
221 #pragma omp target teams distribute simd map(ps) is_device_ptr(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
222 for (int i
=0; i
<100; i
++)
224 #pragma omp target teams distribute simd is_device_ptr(ps) map(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
225 for (int i
=0; i
<100; i
++)
227 #pragma omp target teams distribute simd map(ps->a) is_device_ptr(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
228 for (int i
=0; i
<100; i
++)
230 #pragma omp target teams distribute simd is_device_ptr(ps) map(ps->a) // expected-error{{pointer cannot be mapped along with a section derived from itself}} expected-note{{used here}}
231 for (int i
=0; i
<100; i
++)
233 #pragma omp target teams distribute simd is_device_ptr(ps) firstprivate(ps) // omp4-error{{firstprivate variable cannot be in a is_device_ptr clause in '#pragma omp target teams distribute simd' directive}}
234 for (int i
=0; i
<100; i
++)
236 #pragma omp target teams distribute simd firstprivate(ps) is_device_ptr(ps) // expected-error{{firstprivate variable cannot be in a is_device_ptr clause in '#pragma omp target teams distribute simd' directive}} expected-note{{defined as firstprivate}}
237 for (int i
=0; i
<100; i
++)
239 #pragma omp target teams distribute simd is_device_ptr(ps) private(ps) // omp4-error{{private variable cannot be in a is_device_ptr clause in '#pragma omp target teams distribute simd' directive}}
240 for (int i
=0; i
<100; i
++)
242 #pragma omp target teams distribute simd private(ps) is_device_ptr(ps) // expected-error{{private variable cannot be in a is_device_ptr clause in '#pragma omp target teams distribute simd' directive}} expected-note{{defined as private}}
243 for (int i
=0; i
<100; i
++)
248 int main(int argc
, char **argv
) {
250 const int da
[5] = { 0 };
262 #pragma omp target teams distribute simd is_device_ptr // expected-error {{expected '(' after 'is_device_ptr'}}
263 for (int i
=0; i
<100; i
++)
265 #pragma omp target teams distribute simd is_device_ptr( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}}
266 for (int i
=0; i
<100; i
++)
268 #pragma omp target teams distribute simd is_device_ptr() // expected-error {{expected expression}}
269 for (int i
=0; i
<100; i
++)
271 #pragma omp target teams distribute simd is_device_ptr(alloc) // expected-error {{use of undeclared identifier 'alloc'}}
272 for (int i
=0; i
<100; i
++)
274 #pragma omp target teams distribute simd 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'}}
275 for (int i
=0; i
<100; i
++)
277 #pragma omp target teams distribute simd is_device_ptr(i) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
278 for (int i
=0; i
<100; i
++)
280 #pragma omp target teams distribute simd is_device_ptr(j) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
281 for (int i
=0; i
<100; i
++)
283 #pragma omp target teams distribute simd is_device_ptr(k) // OK
284 for (int i
=0; i
<100; i
++)
286 #pragma omp target teams distribute simd is_device_ptr(z) // OK
287 for (int i
=0; i
<100; i
++)
289 #pragma omp target teams distribute simd is_device_ptr(aa) // OK
290 for (int i
=0; i
<100; i
++)
292 #pragma omp target teams distribute simd is_device_ptr(raa) // OK
293 for (int i
=0; i
<100; i
++)
295 #pragma omp target teams distribute simd is_device_ptr(e) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
296 for (int i
=0; i
<100; i
++)
298 #pragma omp target teams distribute simd is_device_ptr(g) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
299 for (int i
=0; i
<100; i
++)
301 #pragma omp target teams distribute simd is_device_ptr(h) // OK
302 for (int i
=0; i
<100; i
++)
304 #pragma omp target teams distribute simd is_device_ptr(rh) // OK
305 for (int i
=0; i
<100; i
++)
307 #pragma omp target teams distribute simd is_device_ptr(k,i,j) // expected-error2 {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
308 for (int i
=0; i
<100; i
++)
310 #pragma omp target teams distribute simd is_device_ptr(d) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
311 for (int i
=0; i
<100; i
++)
313 #pragma omp target teams distribute simd is_device_ptr(da) // OK
314 for (int i
=0; i
<100; i
++)
316 #pragma omp target teams distribute simd map(ps) is_device_ptr(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
317 for (int i
=0; i
<100; i
++)
319 #pragma omp target teams distribute simd is_device_ptr(ps) map(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
320 for (int i
=0; i
<100; i
++)
322 #pragma omp target teams distribute simd map(ps->a) is_device_ptr(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
323 for (int i
=0; i
<100; i
++)
325 #pragma omp target teams distribute simd is_device_ptr(ps) map(ps->a) // expected-error{{pointer cannot be mapped along with a section derived from itself}} expected-note{{used here}}
326 for (int i
=0; i
<100; i
++)
328 #pragma omp target teams distribute simd is_device_ptr(ps) firstprivate(ps) // omp4-error{{firstprivate variable cannot be in a is_device_ptr clause in '#pragma omp target teams distribute simd' directive}}
329 for (int i
=0; i
<100; i
++)
331 #pragma omp target teams distribute simd firstprivate(ps) is_device_ptr(ps) // expected-error{{firstprivate variable cannot be in a is_device_ptr clause in '#pragma omp target teams distribute simd' directive}} expected-note{{defined as firstprivate}}
332 for (int i
=0; i
<100; i
++)
334 #pragma omp target teams distribute simd is_device_ptr(ps) private(ps) // omp4-error{{private variable cannot be in a is_device_ptr clause in '#pragma omp target teams distribute simd' directive}}
335 for (int i
=0; i
<100; i
++)
337 #pragma omp target teams distribute simd private(ps) is_device_ptr(ps) // expected-error{{private variable cannot be in a is_device_ptr clause in '#pragma omp target teams distribute simd' directive}} expected-note{{defined as private}}
338 for (int i
=0; i
<100; i
++)
340 return tmain
<int, 3>(argc
); // expected-note {{in instantiation of function template specialization 'tmain<int, 3>' requested here}}