1 // RUN: %clang_cc1 -std=c++11 -verify=expected,omp45 -fopenmp -fopenmp-version=45 -ferror-limit 200 %s -Wuninitialized
2 // RUN: %clang_cc1 -std=c++11 -verify=expected,omp50 -fopenmp -ferror-limit 200 %s -Wuninitialized
4 // RUN: %clang_cc1 -std=c++11 -verify=expected,omp45 -fopenmp-simd -fopenmp-version=45 -ferror-limit 200 %s -Wuninitialized
5 // RUN: %clang_cc1 -std=c++11 -verify=expected,omp50 -fopenmp-simd -ferror-limit 200 %s -Wuninitialized
13 const int da
[5] = { 0 };
24 #pragma omp target is_device_ptr // expected-error {{expected '(' after 'is_device_ptr'}}
26 #pragma omp target is_device_ptr( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}}
28 #pragma omp target is_device_ptr() // expected-error {{expected expression}}
30 #pragma omp target is_device_ptr(alloc) // expected-error {{use of undeclared identifier 'alloc'}}
32 #pragma omp target 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'}}
34 #pragma omp target is_device_ptr(i) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
36 #pragma omp target is_device_ptr(j) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
38 #pragma omp target is_device_ptr(k) // OK
40 #pragma omp target is_device_ptr(z) // OK
42 #pragma omp target is_device_ptr(aa) // OK
44 #pragma omp target is_device_ptr(raa) // OK
46 #pragma omp target is_device_ptr(e) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
48 #pragma omp target is_device_ptr(g) // OK
50 #pragma omp target is_device_ptr(rg) // OK
52 #pragma omp target is_device_ptr(k,i,j) // expected-error2 {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
54 #pragma omp target is_device_ptr(d) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
56 #pragma omp target is_device_ptr(da) // OK
83 SC(SB
*&_RPtrS
) : RPtrS(_RPtrS
) {}
97 S2(S2
&s2
):a(s2
.a
) { }
99 static const float S2sc
;
101 const float S2::S2sc
= 0;
108 S3(S3
&s3
):a(s3
.a
) { }
123 S5(const S5
&s5
):a(s5
.a
) { }
129 #pragma omp threadprivate(h)
135 template <typename T
, int I
>
138 const T da
[5] = { 0 };
150 #pragma omp target is_device_ptr // expected-error {{expected '(' after 'is_device_ptr'}}
152 #pragma omp target is_device_ptr( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}}
154 #pragma omp target is_device_ptr() // expected-error {{expected expression}}
156 #pragma omp target is_device_ptr(alloc) // expected-error {{use of undeclared identifier 'alloc'}}
158 #pragma omp target 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'}}
160 #pragma omp target is_device_ptr(i) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
162 #pragma omp target is_device_ptr(j) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
164 #pragma omp target is_device_ptr(k) // OK
166 #pragma omp target is_device_ptr(z) // OK
168 #pragma omp target is_device_ptr(aa) // OK
170 #pragma omp target is_device_ptr(raa) // OK
172 #pragma omp target is_device_ptr(e) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
174 #pragma omp target is_device_ptr(g) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
176 #pragma omp target is_device_ptr(h) // OK
178 #pragma omp target is_device_ptr(rh) // OK
180 #pragma omp target is_device_ptr(k,i,j) // expected-error2 {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
182 #pragma omp target is_device_ptr(d) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
184 #pragma omp target is_device_ptr(da) // OK
186 #pragma omp target map(ps) is_device_ptr(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
188 #pragma omp target is_device_ptr(ps) map(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
190 #pragma omp target map(ps->a) is_device_ptr(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
192 #pragma omp target is_device_ptr(ps) map(ps->a) // expected-error{{pointer cannot be mapped along with a section derived from itself}} expected-note{{used here}}
194 #pragma omp target is_device_ptr(ps) firstprivate(ps) // expected-error{{firstprivate variable cannot be in a is_device_ptr clause in '#pragma omp target' directive}}
196 #pragma omp target firstprivate(ps) is_device_ptr(ps) // expected-error{{firstprivate variable cannot be in a is_device_ptr clause in '#pragma omp target' directive}} expected-note{{defined as firstprivate}}
198 #pragma omp target is_device_ptr(ps) private(ps) // expected-error{{private variable cannot be in a is_device_ptr clause in '#pragma omp target' directive}}
200 #pragma omp target private(ps) is_device_ptr(ps) // expected-error{{private variable cannot be in a is_device_ptr clause in '#pragma omp target' directive}} expected-note{{defined as private}}
205 int main(int argc
, char **argv
) {
207 const int da
[5] = { 0 };
219 #pragma omp target is_device_ptr // expected-error {{expected '(' after 'is_device_ptr'}}
221 #pragma omp target is_device_ptr( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}}
223 #pragma omp target is_device_ptr() // expected-error {{expected expression}}
225 #pragma omp target is_device_ptr(alloc) // expected-error {{use of undeclared identifier 'alloc'}}
227 #pragma omp target 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'}}
229 #pragma omp target is_device_ptr(i) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
231 #pragma omp target is_device_ptr(j) // expected-error {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
233 #pragma omp target is_device_ptr(k) // OK
235 #pragma omp target is_device_ptr(z) // OK
237 #pragma omp target is_device_ptr(aa) // OK
239 #pragma omp target is_device_ptr(raa) // OK
241 #pragma omp target is_device_ptr(e) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
243 #pragma omp target is_device_ptr(g) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
245 #pragma omp target is_device_ptr(h) // OK
247 #pragma omp target is_device_ptr(rh) // OK
249 #pragma omp target is_device_ptr(k,i,j) // expected-error2 {{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
251 #pragma omp target is_device_ptr(d) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
253 #pragma omp target is_device_ptr(da) // OK
255 #pragma omp target map(ps) is_device_ptr(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
257 #pragma omp target is_device_ptr(ps) map(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
259 #pragma omp target map(ps->a) is_device_ptr(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
261 #pragma omp target is_device_ptr(ps) map(ps->a) // expected-error{{pointer cannot be mapped along with a section derived from itself}} expected-note{{used here}}
263 #pragma omp target is_device_ptr(ps) firstprivate(ps) // expected-error{{firstprivate variable cannot be in a is_device_ptr clause in '#pragma omp target' directive}}
265 #pragma omp target firstprivate(ps) is_device_ptr(ps) // expected-error{{firstprivate variable cannot be in a is_device_ptr clause in '#pragma omp target' directive}} expected-note{{defined as firstprivate}}
267 #pragma omp target is_device_ptr(ps) private(ps) // expected-error{{private variable cannot be in a is_device_ptr clause in '#pragma omp target' directive}}
269 #pragma omp target private(ps) is_device_ptr(ps) // expected-error{{private variable cannot be in a is_device_ptr clause in '#pragma omp target' directive}} expected-note{{defined as private}}
271 return tmain
<int, 3>(argc
); // expected-note {{in instantiation of function template specialization 'tmain<int, 3>' requested here}}