1 // RUN: %clang_cc1 -std=c++11 -verify \
2 // RUN: -fopenmp -ferror-limit 200 %s -Wuninitialized
4 // RUN: %clang_cc1 -std=c++11 -verify \
5 // RUN: -fopenmp-simd -ferror-limit 200 %s -Wuninitialized
14 const int da
[5] = { 0 };
25 #pragma omp target has_device_addr // expected-error {{expected '(' after 'has_device_addr'}}
27 #pragma omp target has_device_addr( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}}
29 #pragma omp target has_device_addr() // expected-error {{expected expression}}
31 #pragma omp target has_device_addr(alloc) // expected-error {{use of undeclared identifier 'alloc'}}
33 #pragma omp target has_device_addr(arg // expected-error {{expected ')'}} expected-note {{to match this '('}}
35 #pragma omp target has_device_addr(i) // OK
37 #pragma omp target has_device_addr(j) // OK
39 #pragma omp target has_device_addr(k) // OK
41 #pragma omp target has_device_addr(z) // OK
43 #pragma omp target has_device_addr(aa) // OK
45 #pragma omp target has_device_addr(raa) // OK
47 #pragma omp target has_device_addr(e) // OK
49 #pragma omp target has_device_addr(g) // OK
51 #pragma omp target has_device_addr(rg) // OK
53 #pragma omp target has_device_addr(k,i,j) // OK
55 #pragma omp target has_device_addr(d) // OK
57 #pragma omp target has_device_addr(da) // OK
84 SC(SB
*&_RPtrS
) : RPtrS(_RPtrS
) {}
98 S2(S2
&s2
):a(s2
.a
) { }
100 static const float S2sc
;
102 const float S2::S2sc
= 0;
109 S3(S3
&s3
):a(s3
.a
) { }
124 S5(const S5
&s5
):a(s5
.a
) { }
130 #pragma omp threadprivate(h)
136 template <typename T
, int I
>
139 const T da
[5] = { 0 };
151 #pragma omp target has_device_addr // expected-error {{expected '(' after 'has_device_addr'}}
153 #pragma omp target has_device_addr( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}}
155 #pragma omp target has_device_addr() // expected-error {{expected expression}}
157 #pragma omp target has_device_addr(alloc) // expected-error {{use of undeclared identifier 'alloc'}}
159 #pragma omp target has_device_addr(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
161 #pragma omp target has_device_addr(i) // OK
163 #pragma omp target has_device_addr(j) // OK
165 #pragma omp target has_device_addr(k) // OK
167 #pragma omp target has_device_addr(z) // OK
169 #pragma omp target has_device_addr(aa) // OK
171 #pragma omp target has_device_addr(raa) // OK
173 #pragma omp target has_device_addr(e) // OK
175 #pragma omp target has_device_addr(g) // OK
177 #pragma omp target has_device_addr(h) // OK
179 #pragma omp target has_device_addr(rh) // OK
181 #pragma omp target has_device_addr(k,i,j) // OK
183 #pragma omp target has_device_addr(d) // OK
185 #pragma omp target has_device_addr(da) // OK
187 #pragma omp target map(ps) has_device_addr(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
189 #pragma omp target has_device_addr(ps) map(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
191 #pragma omp target map(ps->a) has_device_addr(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
193 #pragma omp target has_device_addr(ps) map(ps->a) // expected-error{{pointer cannot be mapped along with a section derived from itself}} expected-note{{used here}}
195 #pragma omp target has_device_addr(ps) firstprivate(ps) // expected-error{{firstprivate variable cannot be in a has_device_addr clause in '#pragma omp target' directive}}
197 #pragma omp target firstprivate(ps) has_device_addr(ps) // expected-error{{firstprivate variable cannot be in a has_device_addr clause in '#pragma omp target' directive}} expected-note{{defined as firstprivate}}
199 #pragma omp target has_device_addr(ps) private(ps) // expected-error{{private variable cannot be in a has_device_addr clause in '#pragma omp target' directive}}
201 #pragma omp target private(ps) has_device_addr(ps) // expected-error{{private variable cannot be in a has_device_addr clause in '#pragma omp target' directive}} expected-note{{defined as private}}
206 int main(int argc
, char **argv
) {
208 const int da
[5] = { 0 };
220 #pragma omp target has_device_addr // expected-error {{expected '(' after 'has_device_addr'}}
222 #pragma omp target has_device_addr( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}}
224 #pragma omp target has_device_addr() // expected-error {{expected expression}}
226 #pragma omp target has_device_addr(alloc) // expected-error {{use of undeclared identifier 'alloc'}}
228 #pragma omp target has_device_addr(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
230 #pragma omp target has_device_addr(i) // OK
232 #pragma omp target has_device_addr(j) // OK
234 #pragma omp target has_device_addr(k) // OK
236 #pragma omp target has_device_addr(z) // OK
238 #pragma omp target has_device_addr(aa) // OK
240 #pragma omp target has_device_addr(raa) // OK
242 #pragma omp target has_device_addr(e) // OK
244 #pragma omp target has_device_addr(g) // OK
246 #pragma omp target has_device_addr(h) // OK
248 #pragma omp target has_device_addr(rh) // OK
250 #pragma omp target has_device_addr(k,i,j) // OK
252 #pragma omp target has_device_addr(d) // OK
254 #pragma omp target has_device_addr(da) // OK
256 #pragma omp target map(ps) has_device_addr(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
258 #pragma omp target has_device_addr(ps) map(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
260 #pragma omp target map(ps->a) has_device_addr(ps) // expected-error{{variable already marked as mapped in current construct}} expected-note{{used here}}
262 #pragma omp target has_device_addr(ps) map(ps->a) // expected-error{{pointer cannot be mapped along with a section derived from itself}} expected-note{{used here}}
264 #pragma omp target has_device_addr(ps) firstprivate(ps) // expected-error{{firstprivate variable cannot be in a has_device_addr clause in '#pragma omp target' directive}}
266 #pragma omp target firstprivate(ps) has_device_addr(ps) // expected-error{{firstprivate variable cannot be in a has_device_addr clause in '#pragma omp target' directive}} expected-note{{defined as firstprivate}}
268 #pragma omp target has_device_addr(ps) private(ps) // expected-error{{private variable cannot be in a has_device_addr clause in '#pragma omp target' directive}}
270 #pragma omp target private(ps) has_device_addr(ps) // expected-error{{private variable cannot be in a has_device_addr clause in '#pragma omp target' directive}} expected-note{{defined as private}}
272 return tmain
<int, 3>(argc
);