[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / ParserOpenACC / parse-clauses.c
blob656b31444a9eed390f8898e1bf048ea8ecf3bdd4
1 // RUN: %clang_cc1 %s -verify -fopenacc -std=c99
2 // RUNX: %clang_cc1 %s -verify -fopenacc
3 // RUNX: %clang_cc1 %s -verify -fopenacc -x c++
5 void func() {
7 // expected-warning@+2{{OpenACC clause 'finalize' not yet implemented, clause ignored}}
8 // expected-warning@+1{{OpenACC construct 'enter data' not yet implemented, pragma ignored}}
9 #pragma acc enter data finalize
11 // expected-warning@+3{{OpenACC clause 'finalize' not yet implemented, clause ignored}}
12 // expected-warning@+2{{OpenACC clause 'finalize' not yet implemented, clause ignored}}
13 // expected-warning@+1{{OpenACC construct 'enter data' not yet implemented, pragma ignored}}
14 #pragma acc enter data finalize finalize
16 // expected-warning@+3{{OpenACC clause 'finalize' not yet implemented, clause ignored}}
17 // expected-error@+2{{invalid OpenACC clause 'invalid'}}
18 // expected-warning@+1{{OpenACC construct 'enter data' not yet implemented, pragma ignored}}
19 #pragma acc enter data finalize invalid
21 // expected-warning@+3{{OpenACC clause 'finalize' not yet implemented, clause ignored}}
22 // expected-error@+2{{invalid OpenACC clause 'invalid'}}
23 // expected-warning@+1{{OpenACC construct 'enter data' not yet implemented, pragma ignored}}
24 #pragma acc enter data finalize invalid invalid finalize
26 // expected-warning@+3{{OpenACC clause 'wait' not yet implemented, clause ignored}}
27 // expected-warning@+2{{OpenACC clause 'finalize' not yet implemented, clause ignored}}
28 // expected-warning@+1{{OpenACC construct 'enter data' not yet implemented, pragma ignored}}
29 #pragma acc enter data wait finalize
31 // expected-warning@+2{{OpenACC clause 'if_present' not yet implemented, clause ignored}}
32 // expected-warning@+1{{OpenACC construct 'host_data' not yet implemented, pragma ignored}}
33 #pragma acc host_data if_present
35 // expected-warning@+3{{OpenACC clause 'if_present' not yet implemented, clause ignored}}
36 // expected-warning@+2{{OpenACC clause 'if_present' not yet implemented, clause ignored}}
37 // expected-warning@+1{{OpenACC construct 'host_data' not yet implemented, pragma ignored}}
38 #pragma acc host_data if_present, if_present
40 // expected-error@+4{{OpenACC clause 'independent' on 'loop' construct conflicts with previous data dependence clause}}
41 // expected-note@+3{{previous clause is here}}
42 // expected-error@+2{{OpenACC clause 'auto' on 'loop' construct conflicts with previous data dependence clause}}
43 // expected-note@+1{{previous clause is here}}
44 #pragma acc loop seq independent auto
45 for(int i = 0; i < 5;++i) {}
47 // expected-error@+4{{OpenACC clause 'independent' on 'loop' construct conflicts with previous data dependence clause}}
48 // expected-note@+3{{previous clause is here}}
49 // expected-error@+2{{OpenACC clause 'auto' on 'loop' construct conflicts with previous data dependence clause}}
50 // expected-note@+1{{previous clause is here}}
51 #pragma acc loop seq, independent auto
52 for(int i = 0; i < 5;++i) {}
54 // expected-error@+4{{OpenACC clause 'independent' on 'loop' construct conflicts with previous data dependence clause}}
55 // expected-note@+3{{previous clause is here}}
56 // expected-error@+2{{OpenACC clause 'auto' on 'loop' construct conflicts with previous data dependence clause}}
57 // expected-note@+1{{previous clause is here}}
58 #pragma acc loop seq independent, auto
59 for(int i = 0; i < 5;++i) {}
61 // expected-error@+3{{OpenACC clause 'independent' on 'kernels loop' construct conflicts with previous data dependence clause}}
62 // expected-error@+2{{OpenACC clause 'auto' on 'kernels loop' construct conflicts with previous data dependence clause}}
63 // expected-note@+1 2{{previous clause is here}}
64 #pragma acc kernels loop seq independent auto
65 for(int i = 0; i < 5;++i) {}
67 // expected-error@+3{{OpenACC clause 'independent' on 'serial loop' construct conflicts with previous data dependence clause}}
68 // expected-error@+2{{OpenACC clause 'auto' on 'serial loop' construct conflicts with previous data dependence clause}}
69 // expected-note@+1 2{{previous clause is here}}
70 #pragma acc serial loop seq, independent auto
71 for(int i = 0; i < 5;++i) {}
73 // expected-error@+3{{OpenACC clause 'independent' on 'parallel loop' construct conflicts with previous data dependence clause}}
74 // expected-error@+2{{OpenACC clause 'auto' on 'parallel loop' construct conflicts with previous data dependence clause}}
75 // expected-note@+1 2{{previous clause is here}}
76 #pragma acc parallel loop seq independent, auto
77 for(int i = 0; i < 5;++i) {}
80 // expected-error@+1{{expected identifier}}
81 #pragma acc loop , seq
82 for(int i = 0; i < 5;++i) {}
84 // expected-error@+1{{expected identifier}}
85 #pragma acc loop seq,
86 for(int i = 0; i < 5;++i) {}
88 // expected-error@+1{{expected '('}}
89 #pragma acc loop collapse
90 for(int i = 0; i < 5;++i) {}
92 // expected-error@+1{{expected expression}}
93 #pragma acc loop collapse()
94 for(int i = 0; i < 5;++i) {}
96 // expected-error@+2{{invalid tag 'unknown' on 'collapse' clause}}
97 // expected-error@+1{{expected expression}}
98 #pragma acc loop collapse(unknown:)
99 for(int i = 0; i < 5;++i) {}
101 // expected-error@+1{{expected expression}}
102 #pragma acc loop collapse(force:)
103 for(int i = 0; i < 5;++i) {}
105 // expected-error@+1{{invalid tag 'unknown' on 'collapse' clause}}
106 #pragma acc loop collapse(unknown:1)
107 for(int i = 0; i < 5;++i) {}
109 #pragma acc loop collapse(force:1)
110 for(int i = 0; i < 5;++i) {}
112 #pragma acc loop collapse(1)
113 for(int i = 0; i < 5;++i) {}
115 // expected-error@+2{{expected ')'}}
116 // expected-note@+1{{to match this '('}}
117 #pragma acc loop collapse(5, 6)
118 for(int i = 0; i < 5;++i) {}
121 void DefaultClause() {
122 // expected-error@+1{{expected '('}}
123 #pragma acc serial loop default
124 for(int i = 0; i < 5;++i) {}
126 // expected-error@+1{{expected '('}}
127 #pragma acc serial default self
128 for(int i = 0; i < 5;++i) {}
130 // expected-error@+1{{expected '('}}
131 #pragma acc serial default, self
132 for(int i = 0; i < 5;++i) {}
134 // expected-error@+3{{expected identifier}}
135 // expected-error@+2{{expected ')'}}
136 // expected-note@+1{{to match this '('}}
137 #pragma acc serial default(
138 for(int i = 0; i < 5;++i) {}
140 // expected-error@+3{{invalid value for 'default' clause; expected 'present' or 'none'}}
141 // expected-error@+2{{expected ')'}}
142 // expected-note@+1{{to match this '('}}
143 #pragma acc serial default( self
144 for(int i = 0; i < 5;++i) {}
146 // expected-error@+3{{expected identifier}}
147 // expected-error@+2{{expected ')'}}
148 // expected-note@+1{{to match this '('}}
149 #pragma acc serial default(, self
150 for(int i = 0; i < 5;++i) {}
152 // expected-error@+2{{expected '('}}
153 // expected-error@+1{{expected identifier}}
154 #pragma acc serial default)
155 for(int i = 0; i < 5;++i) {}
157 // expected-error@+2{{expected '('}}
158 // expected-error@+1{{expected identifier}}
159 #pragma acc serial default), self
160 for(int i = 0; i < 5;++i) {}
162 // expected-error@+1{{expected identifier}}
163 #pragma acc serial default()
164 for(int i = 0; i < 5;++i) {}
166 // expected-error@+1{{expected identifier}}
167 #pragma acc serial default() self
168 for(int i = 0; i < 5;++i) {}
170 // expected-error@+1{{expected identifier}}
171 #pragma acc serial default(), self
172 for(int i = 0; i < 5;++i) {}
174 // expected-error@+1{{invalid value for 'default' clause; expected 'present' or 'none'}}
175 #pragma acc serial default(invalid)
176 for(int i = 0; i < 5;++i) {}
178 // expected-error@+1{{invalid value for 'default' clause; expected 'present' or 'none'}}
179 #pragma acc serial default(auto) self
180 for(int i = 0; i < 5;++i) {}
182 // expected-error@+1{{invalid value for 'default' clause; expected 'present' or 'none'}}
183 #pragma acc serial default(invalid), self
184 for(int i = 0; i < 5;++i) {}
186 #pragma acc serial default(none)
187 for(int i = 0; i < 5;++i) {}
189 #pragma acc serial default(present), self
190 for(int i = 0; i < 5;++i) {}
193 void IfClause() {
194 int i, j;
195 // expected-error@+1{{expected '('}}
196 #pragma acc serial loop if
197 for(int i = 0; i < 5;++i) {}
199 // expected-error@+1{{expected '('}}
200 #pragma acc serial if private(i)
201 for(int i = 0; i < 5;++i) {}
203 // expected-error@+1{{expected '('}}
204 #pragma acc serial if, private(i)
205 for(int i = 0; i < 5;++i) {}
207 // expected-error@+3{{expected expression}}
208 // expected-error@+2{{expected ')'}}
209 // expected-note@+1{{to match this '('}}
210 #pragma acc serial if(
211 for(int i = 0; i < 5;++i) {}
213 // expected-error@+3{{use of undeclared identifier 'self'}}
214 // expected-error@+2{{expected ')'}}
215 // expected-note@+1{{to match this '('}}
216 #pragma acc serial if( self
217 for(int i = 0; i < 5;++i) {}
219 // expected-error@+4{{expected expression}}
220 // expected-error@+3{{use of undeclared identifier 'self'}}
221 // expected-error@+2{{expected ')'}}
222 // expected-note@+1{{to match this '('}}
223 #pragma acc serial if(, self
224 for(int i = 0; i < 5;++i) {}
226 // expected-error@+2{{expected '('}}
227 // expected-error@+1{{expected identifier}}
228 #pragma acc serial if)
229 for(int i = 0; i < 5;++i) {}
231 // expected-error@+2{{expected '('}}
232 // expected-error@+1{{expected identifier}}
233 #pragma acc serial if) private(i)
234 for(int i = 0; i < 5;++i) {}
236 // expected-error@+2{{expected '('}}
237 // expected-error@+1{{expected identifier}}
238 #pragma acc serial if), private(i)
239 for(int i = 0; i < 5;++i) {}
241 // expected-error@+1{{expected expression}}
242 #pragma acc serial if()
243 for(int i = 0; i < 5;++i) {}
245 // expected-error@+1{{expected expression}}
246 #pragma acc serial if() private(i)
247 for(int i = 0; i < 5;++i) {}
249 // expected-error@+1{{expected expression}}
250 #pragma acc serial if(), private(i)
251 for(int i = 0; i < 5;++i) {}
253 // expected-error@+1{{use of undeclared identifier 'invalid_expr'}}
254 #pragma acc serial if(invalid_expr)
255 for(int i = 0; i < 5;++i) {}
257 // expected-error@+1{{expected expression}}
258 #pragma acc serial if() private(i)
259 for(int i = 0; i < 5;++i) {}
261 #pragma acc serial if(i > j)
262 for(int i = 0; i < 5;++i) {}
264 #pragma acc serial if(1+5>3), private(i)
265 for(int i = 0; i < 5;++i) {}
268 void SelfClause() {
269 #pragma acc serial loop self
270 for(int i = 0; i < 5;++i) {}
272 #pragma acc serial loop self, seq
273 for(int i = 0; i < 5;++i) {}
275 // expected-error@+3{{expected expression}}
276 // expected-error@+2{{expected ')'}}
277 // expected-note@+1{{to match this '('}}
278 #pragma acc serial loop self(
279 for(int i = 0; i < 5;++i) {}
281 // expected-error@+3{{use of undeclared identifier 'seq'}}
282 // expected-error@+2{{expected ')'}}
283 // expected-note@+1{{to match this '('}}
284 #pragma acc serial loop self( seq
285 for(int i = 0; i < 5;++i) {}
287 // expected-error@+4{{expected expression}}
288 // expected-error@+3{{use of undeclared identifier 'seq'}}
289 // expected-error@+2{{expected ')'}}
290 // expected-note@+1{{to match this '('}}
291 #pragma acc serial loop self(, seq
292 for(int i = 0; i < 5;++i) {}
294 // expected-error@+1{{expected identifier}}
295 #pragma acc serial loop self)
296 for(int i = 0; i < 5;++i) {}
298 // expected-error@+1{{expected identifier}}
299 #pragma acc serial loop self) seq
300 for(int i = 0; i < 5;++i) {}
302 // expected-error@+1{{expected identifier}}
303 #pragma acc serial loop self), seq
304 for(int i = 0; i < 5;++i) {}
307 // expected-error@+1{{expected expression}}
308 #pragma acc serial loop self(), seq
309 for(int i = 0; i < 5;++i) {}
311 // expected-error@+2{{expected expression}}
312 // expected-error@+1{{expected expression}}
313 #pragma acc serial loop self(,), seq
314 for(int i = 0; i < 5;++i) {}
316 // expected-error@+1{{use of undeclared identifier 'invalid_expr'}}
317 #pragma acc serial loop self(invalid_expr), seq
318 for(int i = 0; i < 5;++i) {}
320 int i, j;
322 // expected-error@+2{{expected ')'}}
323 // expected-note@+1{{to match this '('}}
324 #pragma acc serial self(i > j
325 for(int i = 0; i < 5;++i) {}
327 // expected-error@+3{{use of undeclared identifier 'seq'}}
328 // expected-error@+2{{expected ')'}}
329 // expected-note@+1{{to match this '('}}
330 #pragma acc serial self(i > j, seq
331 for(int i = 0; i < 5;++i) {}
333 // expected-warning@+1{{left operand of comma operator has no effect}}
334 #pragma acc serial self(i, j)
335 for(int i = 0; i < 5;++i) {}
337 #pragma acc serial self(i > j)
338 for(int i = 0; i < 5;++i) {}
340 #pragma acc serial self(1+5>3), private(i)
341 for(int i = 0; i < 5;++i) {}
344 struct Members {
345 int value;
346 char array[5];
348 struct HasMembersArray {
349 struct Members MemArr[4];
352 // On 'update', self behaves differently and requires parens, plus takes a var-list instead.
353 void SelfUpdate() {
354 struct Members s;
356 // expected-error@+2{{expected '('}}
357 // expected-warning@+1{{OpenACC construct 'update' not yet implemented, pragma ignored}}
358 #pragma acc update self
359 for(int i = 0; i < 5;++i) {}
361 // expected-error@+6{{use of undeclared identifier 'zero'}}
362 // expected-error@+5{{expected ','}}
363 // expected-error@+4{{expected expression}}
364 // expected-warning@+3{{OpenACC clause 'self' not yet implemented, clause ignored}}
365 // expected-warning@+2{{OpenACC clause 'if_present' not yet implemented, clause ignored}}
366 // expected-warning@+1{{OpenACC construct 'update' not yet implemented, pragma ignored}}
367 #pragma acc update self(zero : s.array[s.value : 5], s.value), if_present
368 for(int i = 0; i < 5;++i) {}
370 // expected-warning@+3{{OpenACC clause 'self' not yet implemented, clause ignored}}
371 // expected-warning@+2{{OpenACC clause 'if_present' not yet implemented, clause ignored}}
372 // expected-warning@+1{{OpenACC construct 'update' not yet implemented, pragma ignored}}
373 #pragma acc update self(s.array[s.value : 5], s.value), if_present
374 for(int i = 0; i < 5;++i) {}
377 void VarListClauses() {
378 // expected-error@+1{{expected '('}}
379 #pragma acc serial copy
380 for(int i = 0; i < 5;++i) {}
382 // expected-error@+1{{expected '('}}
383 #pragma acc serial copy, self
384 for(int i = 0; i < 5;++i) {}
386 // expected-error@+2{{expected '('}}
387 // expected-error@+1{{expected identifier}}
388 #pragma acc serial copy)
389 for(int i = 0; i < 5;++i) {}
391 // expected-error@+2{{expected '('}}
392 // expected-error@+1{{expected identifier}}
393 #pragma acc serial copy), self
394 for(int i = 0; i < 5;++i) {}
396 // expected-error@+3{{expected expression}}
397 // expected-error@+2{{expected ')'}}
398 // expected-note@+1{{to match this '('}}
399 #pragma acc serial copy(
400 for(int i = 0; i < 5;++i) {}
402 // expected-error@+3{{expected expression}}
403 // expected-error@+2{{expected ')'}}
404 // expected-note@+1{{to match this '('}}
405 #pragma acc serial copy(, self
406 for(int i = 0; i < 5;++i) {}
408 // expected-error@+1{{expected expression}}
409 #pragma acc serial copy()
410 for(int i = 0; i < 5;++i) {}
412 // expected-error@+1{{expected expression}}
413 #pragma acc serial copy(), self
414 for(int i = 0; i < 5;++i) {}
416 struct Members s;
417 struct HasMembersArray HasMem;
419 #pragma acc serial copy(s.array[s.value]), self
420 for(int i = 0; i < 5;++i) {}
422 #pragma acc serial copy(s.array[s.value], s.array[s.value :5] ), self
423 for(int i = 0; i < 5;++i) {}
425 #pragma acc serial copy(HasMem.MemArr[3].array[1]), self
426 for(int i = 0; i < 5;++i) {}
428 #pragma acc serial copy(HasMem.MemArr[3].array[1:4]), self
429 for(int i = 0; i < 5;++i) {}
431 // expected-error@+1{{OpenACC sub-array is not allowed here}}
432 #pragma acc serial copy(HasMem.MemArr[1:3].array[1]), self
433 for(int i = 0; i < 5;++i) {}
435 // expected-error@+1{{OpenACC sub-array is not allowed here}}
436 #pragma acc serial copy(HasMem.MemArr[1:3].array[1:2]), self
437 for(int i = 0; i < 5;++i) {}
439 #pragma acc serial copy(HasMem.MemArr[:]), self
440 for(int i = 0; i < 5;++i) {}
442 // expected-error@+1{{expected expression}}
443 #pragma acc serial copy(HasMem.MemArr[::]), self
444 for(int i = 0; i < 5;++i) {}
446 // expected-error@+3{{expected expression}}
447 // expected-error@+2{{expected ']'}}
448 // expected-note@+1{{to match this '['}}
449 #pragma acc serial copy(HasMem.MemArr[: :]), self
450 for(int i = 0; i < 5;++i) {}
452 #pragma acc serial copy(HasMem.MemArr[3:]), self
453 for(int i = 0; i < 5;++i) {}
455 // expected-warning@+1{{OpenACC clause name 'pcopy' is a deprecated clause name and is now an alias for 'copy'}}
456 #pragma acc serial pcopy(HasMem.MemArr[3:])
457 for(int i = 0; i < 5;++i) {}
459 // expected-warning@+1{{OpenACC clause name 'present_or_copy' is a deprecated clause name and is now an alias for 'copy'}}
460 #pragma acc serial present_or_copy(HasMem.MemArr[3:])
461 for(int i = 0; i < 5;++i) {}
463 // expected-error@+2{{expected ','}}
464 // expected-warning@+1{{OpenACC clause 'use_device' not yet implemented, clause ignored}}
465 #pragma acc serial use_device(s.array[s.value] s.array[s.value :5] ), self
466 for(int i = 0; i < 5;++i) {}
468 // expected-warning@+1{{OpenACC clause 'use_device' not yet implemented, clause ignored}}
469 #pragma acc serial use_device(s.array[s.value : 5]), self
470 for(int i = 0; i < 5;++i) {}
472 // expected-error@+1{{expected ','}}
473 #pragma acc serial no_create(s.array[s.value] s.array[s.value :5] ), self
474 for(int i = 0; i < 5;++i) {}
476 #pragma acc serial no_create(s.array[s.value : 5], s.value), self
477 for(int i = 0; i < 5;++i) {}
479 // expected-error@+1{{expected ','}}
480 #pragma acc serial present(s.array[s.value] s.array[s.value :5] ), self
481 for(int i = 0; i < 5;++i) {}
483 #pragma acc serial present(s.array[s.value : 5], s.value), self
484 for(int i = 0; i < 5;++i) {}
487 void *IsPointer;
488 // expected-error@+4{{expected ','}}
489 // expected-error@+3{{expected pointer in 'deviceptr' clause, type is 'char'}}
490 // expected-error@+2{{OpenACC sub-array is not allowed here}}
491 // expected-note@+1{{expected variable of pointer type}}
492 #pragma acc serial deviceptr(s.array[s.value] s.array[s.value :5] ), self
493 for(int i = 0; i < 5;++i) {}
495 #pragma acc serial deviceptr(IsPointer), self
496 for(int i = 0; i < 5;++i) {}
498 // expected-error@+4{{expected ','}}
499 // expected-error@+3{{expected pointer in 'attach' clause, type is 'char'}}
500 // expected-error@+2{{OpenACC sub-array is not allowed here}}
501 // expected-note@+1{{expected variable of pointer type}}
502 #pragma acc serial attach(s.array[s.value] s.array[s.value :5] ), self
503 for(int i = 0; i < 5;++i) {}
505 #pragma acc serial attach(IsPointer), self
506 for(int i = 0; i < 5;++i) {}
508 // expected-error@+2{{expected ','}}
509 // expected-warning@+1{{OpenACC clause 'detach' not yet implemented, clause ignored}}
510 #pragma acc serial detach(s.array[s.value] s.array[s.value :5] ), self
511 for(int i = 0; i < 5;++i) {}
513 // expected-warning@+1{{OpenACC clause 'detach' not yet implemented, clause ignored}}
514 #pragma acc serial detach(s.array[s.value : 5], s.value), self
515 for(int i = 0; i < 5;++i) {}
517 // expected-error@+1{{expected ','}}
518 #pragma acc serial private(s.array[s.value] s.array[s.value :5] ), self
519 for(int i = 0; i < 5;++i) {}
521 #pragma acc serial private(s.array[s.value : 5], s.value), self
522 for(int i = 0; i < 5;++i) {}
524 // expected-error@+1{{expected ','}}
525 #pragma acc serial firstprivate(s.array[s.value] s.array[s.value :5] ), self
526 for(int i = 0; i < 5;++i) {}
528 #pragma acc serial firstprivate(s.array[s.value : 5], s.value), self
529 for(int i = 0; i < 5;++i) {}
531 // expected-error@+2{{expected ','}}
532 // expected-warning@+1{{OpenACC clause 'delete' not yet implemented, clause ignored}}
533 #pragma acc serial delete(s.array[s.value] s.array[s.value :5] ), self
534 for(int i = 0; i < 5;++i) {}
536 // expected-warning@+1{{OpenACC clause 'delete' not yet implemented, clause ignored}}
537 #pragma acc serial delete(s.array[s.value : 5], s.value), self
538 for(int i = 0; i < 5;++i) {}
540 // expected-error@+2{{expected ','}}
541 // expected-warning@+1{{OpenACC clause 'use_device' not yet implemented, clause ignored}}
542 #pragma acc serial use_device(s.array[s.value] s.array[s.value :5] ), self
543 for(int i = 0; i < 5;++i) {}
545 // expected-warning@+1{{OpenACC clause 'use_device' not yet implemented, clause ignored}}
546 #pragma acc serial use_device(s.array[s.value : 5], s.value), self
547 for(int i = 0; i < 5;++i) {}
549 // expected-error@+2{{expected ','}}
550 // expected-warning@+1{{OpenACC clause 'device_resident' not yet implemented, clause ignored}}
551 #pragma acc serial device_resident(s.array[s.value] s.array[s.value :5] ), self
552 for(int i = 0; i < 5;++i) {}
554 // expected-warning@+1{{OpenACC clause 'device_resident' not yet implemented, clause ignored}}
555 #pragma acc serial device_resident(s.array[s.value : 5], s.value), self
556 for(int i = 0; i < 5;++i) {}
558 // expected-error@+2{{expected ','}}
559 // expected-warning@+1{{OpenACC clause 'link' not yet implemented, clause ignored}}
560 #pragma acc serial link(s.array[s.value] s.array[s.value :5] ), self
561 for(int i = 0; i < 5;++i) {}
563 // expected-warning@+1{{OpenACC clause 'link' not yet implemented, clause ignored}}
564 #pragma acc serial link(s.array[s.value : 5], s.value), self
565 for(int i = 0; i < 5;++i) {}
567 // expected-error@+2{{expected ','}}
568 // expected-warning@+1{{OpenACC clause 'host' not yet implemented, clause ignored}}
569 #pragma acc serial host(s.array[s.value] s.array[s.value :5] ), self
570 for(int i = 0; i < 5;++i) {}
572 // expected-warning@+1{{OpenACC clause 'host' not yet implemented, clause ignored}}
573 #pragma acc serial host(s.array[s.value : 5], s.value), self
574 for(int i = 0; i < 5;++i) {}
576 // expected-error@+2{{expected ','}}
577 // expected-warning@+1{{OpenACC clause 'device' not yet implemented, clause ignored}}
578 #pragma acc serial device(s.array[s.value] s.array[s.value :5] ), self
579 for(int i = 0; i < 5;++i) {}
581 // expected-warning@+1{{OpenACC clause 'device' not yet implemented, clause ignored}}
582 #pragma acc serial device(s.array[s.value : 5], s.value), self
583 for(int i = 0; i < 5;++i) {}
585 // expected-error@+1{{expected ','}}
586 #pragma acc serial copyout(s.array[s.value] s.array[s.value :5] ), self
587 for(int i = 0; i < 5;++i) {}
589 #pragma acc serial copyout(s.array[s.value : 5], s.value), self
590 for(int i = 0; i < 5;++i) {}
592 #pragma acc serial copyout(zero:s.array[s.value : 5], s.value), self
593 for(int i = 0; i < 5;++i) {}
595 // expected-warning@+1{{OpenACC clause name 'pcopyout' is a deprecated clause name and is now an alias for 'copyout'}}
596 #pragma acc serial pcopyout(s.array[s.value : 5], s.value)
597 for(int i = 0; i < 5;++i) {}
599 // expected-warning@+1{{OpenACC clause name 'present_or_copyout' is a deprecated clause name and is now an alias for 'copyout'}}
600 #pragma acc serial present_or_copyout(zero:s.array[s.value : 5], s.value)
601 for(int i = 0; i < 5;++i) {}
603 #pragma acc serial copyout(zero : s.array[s.value : 5], s.value), self
604 for(int i = 0; i < 5;++i) {}
606 // expected-error@+2{{use of undeclared identifier 'zero'}}
607 // expected-error@+1{{expected ','}}
608 #pragma acc serial copyout(zero s.array[s.value : 5], s.value), self
609 for(int i = 0; i < 5;++i) {}
611 // expected-error@+1{{invalid tag 'readonly' on 'copyout' clause}}
612 #pragma acc serial copyout(readonly:s.array[s.value : 5], s.value), self
613 for(int i = 0; i < 5;++i) {}
615 // expected-error@+1{{invalid tag 'invalid' on 'copyout' clause}}
616 #pragma acc serial copyout(invalid:s.array[s.value : 5], s.value), self
617 for(int i = 0; i < 5;++i) {}
619 // expected-error@+1{{invalid tag 'invalid' on 'copyout' clause}}
620 #pragma acc serial copyout(invalid:s.array[s.value : 5], s.value), self
621 for(int i = 0; i < 5;++i) {}
623 // expected-error@+2{{use of undeclared identifier 'invalid'}}
624 // expected-error@+1{{expected ','}}
625 #pragma acc serial copyout(invalid s.array[s.value : 5], s.value), self
626 for(int i = 0; i < 5;++i) {}
628 // expected-error@+1{{expected ','}}
629 #pragma acc serial create(s.array[s.value] s.array[s.value :5] ), self
630 for(int i = 0; i < 5;++i) {}
632 #pragma acc serial create(s.array[s.value : 5], s.value), self
633 for(int i = 0; i < 5;++i) {}
635 #pragma acc serial create(zero:s.array[s.value : 5], s.value), self
636 for(int i = 0; i < 5;++i) {}
638 // expected-warning@+1{{OpenACC clause name 'pcreate' is a deprecated clause name and is now an alias for 'create'}}
639 #pragma acc serial pcreate(s.array[s.value : 5], s.value)
640 for(int i = 0; i < 5;++i) {}
642 // expected-warning@+1{{OpenACC clause name 'present_or_create' is a deprecated clause name and is now an alias for 'create'}}
643 #pragma acc serial present_or_create(zero:s.array[s.value : 5], s.value)
644 for(int i = 0; i < 5;++i) {}
646 #pragma acc serial create(zero : s.array[s.value : 5], s.value), self
647 for(int i = 0; i < 5;++i) {}
649 // expected-error@+2{{use of undeclared identifier 'zero'}}
650 // expected-error@+1{{expected ','}}
651 #pragma acc serial create(zero s.array[s.value : 5], s.value), self
652 for(int i = 0; i < 5;++i) {}
654 // expected-error@+1{{invalid tag 'readonly' on 'create' clause}}
655 #pragma acc serial create(readonly:s.array[s.value : 5], s.value), self
656 for(int i = 0; i < 5;++i) {}
658 // expected-error@+1{{invalid tag 'invalid' on 'create' clause}}
659 #pragma acc serial create(invalid:s.array[s.value : 5], s.value), self
660 for(int i = 0; i < 5;++i) {}
662 // expected-error@+1{{invalid tag 'invalid' on 'create' clause}}
663 #pragma acc serial create(invalid:s.array[s.value : 5], s.value), self
664 for(int i = 0; i < 5;++i) {}
666 // expected-error@+2{{use of undeclared identifier 'invalid'}}
667 // expected-error@+1{{expected ','}}
668 #pragma acc serial create(invalid s.array[s.value : 5], s.value), self
669 for(int i = 0; i < 5;++i) {}
671 // expected-error@+1{{expected ','}}
672 #pragma acc serial copyin(s.array[s.value] s.array[s.value :5] ), self
673 for(int i = 0; i < 5;++i) {}
675 #pragma acc serial copyin(s.array[s.value : 5], s.value), self
676 for(int i = 0; i < 5;++i) {}
678 #pragma acc serial copyin(readonly:s.array[s.value : 5], s.value), self
679 for(int i = 0; i < 5;++i) {}
681 // expected-warning@+1{{OpenACC clause name 'pcopyin' is a deprecated clause name and is now an alias for 'copyin'}}
682 #pragma acc serial pcopyin(s.array[s.value : 5], s.value)
683 for(int i = 0; i < 5;++i) {}
685 // expected-warning@+1{{OpenACC clause name 'present_or_copyin' is a deprecated clause name and is now an alias for 'copyin'}}
686 #pragma acc serial present_or_copyin(readonly:s.array[s.value : 5], s.value)
687 for(int i = 0; i < 5;++i) {}
689 #pragma acc serial copyin(readonly : s.array[s.value : 5], s.value), self
690 for(int i = 0; i < 5;++i) {}
692 // expected-error@+2{{use of undeclared identifier 'readonly'}}
693 // expected-error@+1{{expected ','}}
694 #pragma acc serial copyin(readonly s.array[s.value : 5], s.value), self
695 for(int i = 0; i < 5;++i) {}
697 // expected-error@+1{{invalid tag 'zero' on 'copyin' clause}}
698 #pragma acc serial copyin(zero :s.array[s.value : 5], s.value), self
699 for(int i = 0; i < 5;++i) {}
701 // expected-error@+1{{invalid tag 'invalid' on 'copyin' clause}}
702 #pragma acc serial copyin(invalid:s.array[s.value : 5], s.value), self
703 for(int i = 0; i < 5;++i) {}
705 // expected-error@+1{{invalid tag 'invalid' on 'copyin' clause}}
706 #pragma acc serial copyin(invalid:s.array[s.value : 5], s.value), self
707 for(int i = 0; i < 5;++i) {}
709 // expected-error@+2{{use of undeclared identifier 'invalid'}}
710 // expected-error@+1{{expected ','}}
711 #pragma acc serial copyin(invalid s.array[s.value : 5], s.value), self
712 for(int i = 0; i < 5;++i) {}
715 void ReductionClauseParsing() {
716 char *Begin, *End;
717 // expected-error@+1{{expected '('}}
718 #pragma acc serial reduction
719 for(int i = 0; i < 5;++i) {}
720 // expected-error@+2{{missing reduction operator, expected '+', '*', 'max', 'min', '&', '|', '^', '&&', or '||', follwed by a ':'}}
721 // expected-error@+1{{expected expression}}
722 #pragma acc serial reduction()
723 for(int i = 0; i < 5;++i) {}
724 // expected-error@+1{{missing reduction operator, expected '+', '*', 'max', 'min', '&', '|', '^', '&&', or '||', follwed by a ':'}}
725 #pragma acc serial reduction(Begin)
726 for(int i = 0; i < 5;++i) {}
727 // expected-error@+1{{missing reduction operator, expected '+', '*', 'max', 'min', '&', '|', '^', '&&', or '||', follwed by a ':'}}
728 #pragma acc serial reduction(Begin, End)
729 for(int i = 0; i < 5;++i) {}
730 // expected-error@+1{{missing reduction operator, expected '+', '*', 'max', 'min', '&', '|', '^', '&&', or '||', follwed by a ':'}}
731 #pragma acc serial reduction(Begin, End)
732 for(int i = 0; i < 5;++i) {}
733 #pragma acc serial reduction(+:Begin)
734 for(int i = 0; i < 5;++i) {}
735 #pragma acc serial reduction(+:Begin, End)
736 for(int i = 0; i < 5;++i) {}
737 #pragma acc serial reduction(*: Begin, End)
738 for(int i = 0; i < 5;++i) {}
739 #pragma acc serial reduction(max : Begin, End)
740 for(int i = 0; i < 5;++i) {}
741 #pragma acc serial reduction(min: Begin, End)
742 for(int i = 0; i < 5;++i) {}
743 #pragma acc serial reduction(&: Begin, End)
744 for(int i = 0; i < 5;++i) {}
745 #pragma acc serial reduction(|: Begin, End)
746 for(int i = 0; i < 5;++i) {}
747 #pragma acc serial reduction(^: Begin, End)
748 for(int i = 0; i < 5;++i) {}
749 #pragma acc serial self, reduction(&&: Begin, End)
750 for(int i = 0; i < 5;++i) {}
751 #pragma acc serial reduction(||: Begin, End), self
752 for(int i = 0; i < 5;++i) {}
755 int returns_int();
757 void IntExprParsing() {
758 // expected-error@+1{{expected '('}}
759 #pragma acc parallel vector_length
762 // expected-error@+1{{expected expression}}
763 #pragma acc parallel vector_length()
766 // expected-error@+1{{use of undeclared identifier 'invalid'}}
767 #pragma acc parallel vector_length(invalid)
770 // expected-error@+2{{expected ')'}}
771 // expected-note@+1{{to match this '('}}
772 #pragma acc parallel vector_length(5, 4)
775 #pragma acc parallel vector_length(5)
778 #pragma acc parallel vector_length(returns_int())
781 // expected-error@+1{{expected '('}}
782 #pragma acc parallel num_gangs
785 // expected-error@+1{{expected expression}}
786 #pragma acc parallel num_gangs()
789 // expected-error@+1{{use of undeclared identifier 'invalid'}}
790 #pragma acc parallel num_gangs(invalid)
793 #pragma acc parallel num_gangs(5, 4)
796 #pragma acc parallel num_gangs(5)
799 #pragma acc parallel num_gangs(returns_int())
802 // expected-error@+1{{expected '('}}
803 #pragma acc parallel num_workers
806 // expected-error@+1{{expected expression}}
807 #pragma acc parallel num_workers()
810 // expected-error@+1{{use of undeclared identifier 'invalid'}}
811 #pragma acc parallel num_workers(invalid)
814 // expected-error@+2{{expected ')'}}
815 // expected-note@+1{{to match this '('}}
816 #pragma acc parallel num_workers(5, 4)
819 #pragma acc parallel num_workers(5)
822 #pragma acc parallel num_workers(returns_int())
825 // expected-error@+2{{expected '('}}
826 // expected-warning@+1{{OpenACC construct 'init' not yet implemented, pragma ignored}}
827 #pragma acc init device_num
829 // expected-error@+2{{expected expression}}
830 // expected-warning@+1{{OpenACC construct 'init' not yet implemented, pragma ignored}}
831 #pragma acc init device_num()
833 // expected-error@+2{{use of undeclared identifier 'invalid'}}
834 // expected-warning@+1{{OpenACC construct 'init' not yet implemented, pragma ignored}}
835 #pragma acc init device_num(invalid)
837 // expected-error@+3{{expected ')'}}
838 // expected-note@+2{{to match this '('}}
839 // expected-warning@+1{{OpenACC construct 'init' not yet implemented, pragma ignored}}
840 #pragma acc init device_num(5, 4)
842 // expected-warning@+2{{OpenACC clause 'device_num' not yet implemented, clause ignored}}
843 // expected-warning@+1{{OpenACC construct 'init' not yet implemented, pragma ignored}}
844 #pragma acc init device_num(5)
846 // expected-warning@+2{{OpenACC clause 'device_num' not yet implemented, clause ignored}}
847 // expected-warning@+1{{OpenACC construct 'init' not yet implemented, pragma ignored}}
848 #pragma acc init device_num(returns_int())
850 // expected-error@+2{{expected '('}}
851 // expected-warning@+1{{OpenACC construct 'set' not yet implemented, pragma ignored}}
852 #pragma acc set default_async
854 // expected-error@+2{{expected expression}}
855 // expected-warning@+1{{OpenACC construct 'set' not yet implemented, pragma ignored}}
856 #pragma acc set default_async()
858 // expected-error@+2{{use of undeclared identifier 'invalid'}}
859 // expected-warning@+1{{OpenACC construct 'set' not yet implemented, pragma ignored}}
860 #pragma acc set default_async(invalid)
862 // expected-error@+3{{expected ')'}}
863 // expected-note@+2{{to match this '('}}
864 // expected-warning@+1{{OpenACC construct 'set' not yet implemented, pragma ignored}}
865 #pragma acc set default_async(5, 4)
867 // expected-warning@+2{{OpenACC clause 'default_async' not yet implemented, clause ignored}}
868 // expected-warning@+1{{OpenACC construct 'set' not yet implemented, pragma ignored}}
869 #pragma acc set default_async(5)
871 // expected-warning@+2{{OpenACC clause 'default_async' not yet implemented, clause ignored}}
872 // expected-warning@+1{{OpenACC construct 'set' not yet implemented, pragma ignored}}
873 #pragma acc set default_async(returns_int())
876 #pragma acc loop vector
877 for(int i = 0; i < 5;++i);
878 // expected-error@+1{{expected expression}}
879 #pragma acc loop vector()
880 for(int i = 0; i < 5;++i);
881 // expected-error@+2{{invalid tag 'invalid' on 'vector' clause}}
882 // expected-error@+1{{expected expression}}
883 #pragma acc loop vector(invalid:)
884 for(int i = 0; i < 5;++i);
885 // expected-error@+1{{invalid tag 'invalid' on 'vector' clause}}
886 #pragma acc loop vector(invalid:5)
887 for(int i = 0; i < 5;++i);
888 // expected-error@+1{{expected expression}}
889 #pragma acc loop vector(length:)
890 for(int i = 0; i < 5;++i);
891 // expected-error@+2{{invalid tag 'num' on 'vector' clause}}
892 // expected-error@+1{{expected expression}}
893 #pragma acc loop vector(num:)
894 for(int i = 0; i < 5;++i);
895 // expected-error@+2{{expected ')'}}
896 // expected-note@+1{{to match this '('}}
897 #pragma acc loop vector(5, 4)
898 for(int i = 0; i < 5;++i);
899 // expected-error@+2{{expected ')'}}
900 // expected-note@+1{{to match this '('}}
901 #pragma acc loop vector(length:6,4)
902 for(int i = 0; i < 5;++i);
903 // expected-error@+3{{invalid tag 'num' on 'vector' clause}}
904 // expected-error@+2{{expected ')'}}
905 // expected-note@+1{{to match this '('}}
906 #pragma acc loop vector(num:6,4)
907 for(int i = 0; i < 5;++i);
908 #pragma acc loop vector(5)
909 for(int i = 0; i < 5;++i);
910 // expected-error@+1{{invalid tag 'num' on 'vector' clause}}
911 #pragma acc loop vector(num:5)
912 for(int i = 0; i < 5;++i);
913 #pragma acc loop vector(length:5)
914 for(int i = 0; i < 5;++i);
915 #pragma acc loop vector(returns_int())
916 for(int i = 0; i < 5;++i);
917 #pragma acc loop vector(length:returns_int())
918 for(int i = 0; i < 5;++i);
920 #pragma acc loop worker
921 for(int i = 0; i < 5;++i);
922 // expected-error@+1{{expected expression}}
923 #pragma acc loop worker()
924 for(int i = 0; i < 5;++i);
925 // expected-error@+2{{invalid tag 'invalid' on 'worker' clause}}
926 // expected-error@+1{{expected expression}}
927 #pragma acc loop worker(invalid:)
928 for(int i = 0; i < 5;++i);
929 #pragma acc kernels
930 // expected-error@+1{{invalid tag 'invalid' on 'worker' clause}}
931 #pragma acc loop worker(invalid:5)
932 for(int i = 0; i < 5;++i);
933 // expected-error@+1{{expected expression}}
934 #pragma acc loop worker(num:)
935 for(int i = 0; i < 5;++i);
936 // expected-error@+2{{invalid tag 'length' on 'worker' clause}}
937 // expected-error@+1{{expected expression}}
938 #pragma acc loop worker(length:)
939 for(int i = 0; i < 5;++i);
940 // expected-error@+2{{expected ')'}}
941 // expected-note@+1{{to match this '('}}
942 #pragma acc loop worker(5, 4)
943 for(int i = 0; i < 5;++i);
944 // expected-error@+2{{expected ')'}}
945 // expected-note@+1{{to match this '('}}
946 #pragma acc loop worker(num:6,4)
947 for(int i = 0; i < 5;++i);
948 // expected-error@+3{{invalid tag 'length' on 'worker' clause}}
949 // expected-error@+2{{expected ')'}}
950 // expected-note@+1{{to match this '('}}
951 #pragma acc loop worker(length:6,4)
952 for(int i = 0; i < 5;++i);
953 #pragma acc kernels
954 #pragma acc loop worker(5)
955 for(int i = 0; i < 5;++i);
956 #pragma acc kernels
957 // expected-error@+1{{invalid tag 'length' on 'worker' clause}}
958 #pragma acc loop worker(length:5)
959 for(int i = 0; i < 5;++i);
960 #pragma acc kernels
961 #pragma acc loop worker(num:5)
962 for(int i = 0; i < 5;++i);
963 #pragma acc kernels
964 #pragma acc loop worker(returns_int())
965 for(int i = 0; i < 5;++i);
966 #pragma acc kernels
967 // expected-error@+1{{invalid tag 'length' on 'worker' clause}}
968 #pragma acc loop worker(length:returns_int())
969 for(int i = 0; i < 5;++i);
972 void device_type() {
973 // expected-error@+1{{expected '('}}
974 #pragma acc parallel device_type
976 // expected-error@+1{{expected '('}}
977 #pragma acc parallel dtype
980 // expected-error@+3{{expected identifier}}
981 // expected-error@+2{{expected ')'}}
982 // expected-note@+1{{to match this '('}}
983 #pragma acc parallel device_type(
985 // expected-error@+3{{expected identifier}}
986 // expected-error@+2{{expected ')'}}
987 // expected-note@+1{{to match this '('}}
988 #pragma acc parallel dtype(
991 // expected-error@+1{{expected identifier}}
992 #pragma acc parallel device_type()
994 // expected-error@+1{{expected identifier}}
995 #pragma acc parallel dtype()
998 // expected-error@+2{{expected ')'}}
999 // expected-note@+1{{to match this '('}}
1000 #pragma acc parallel device_type(*
1002 // expected-error@+2{{expected ')'}}
1003 // expected-note@+1{{to match this '('}}
1004 #pragma acc parallel dtype(*
1007 // expected-error@+2{{expected ')'}}
1008 // expected-note@+1{{to match this '('}}
1009 #pragma acc parallel device_type(ident
1011 // expected-error@+2{{expected ')'}}
1012 // expected-note@+1{{to match this '('}}
1013 #pragma acc parallel dtype(ident
1016 // expected-error@+3{{expected ','}}
1017 // expected-error@+2{{expected ')'}}
1018 // expected-note@+1{{to match this '('}}
1019 #pragma acc parallel device_type(ident ident2
1021 // expected-error@+3{{expected ','}}
1022 // expected-error@+2{{expected ')'}}
1023 // expected-note@+1{{to match this '('}}
1024 #pragma acc parallel dtype(ident ident2
1027 // expected-error@+2{{expected ')'}}
1028 // expected-note@+1{{to match this '('}}
1029 #pragma acc parallel device_type(ident, ident2
1031 // expected-error@+2{{expected ')'}}
1032 // expected-note@+1{{to match this '('}}
1033 #pragma acc parallel dtype(ident, ident2
1036 // expected-error@+1{{expected identifier}}
1037 #pragma acc parallel device_type(ident, ident2,)
1039 // expected-error@+1{{expected identifier}}
1040 #pragma acc parallel dtype(ident, ident2,)
1043 // expected-error@+2{{expected ')'}}
1044 // expected-note@+1{{to match this '('}}
1045 #pragma acc parallel device_type(*,)
1047 // expected-error@+2{{expected ')'}}
1048 // expected-note@+1{{to match this '('}}
1049 #pragma acc parallel dtype(*,)
1052 // expected-error@+2{{expected ')'}}
1053 // expected-note@+1{{to match this '('}}
1054 #pragma acc parallel device_type(*,ident)
1056 // expected-error@+2{{expected ')'}}
1057 // expected-note@+1{{to match this '('}}
1058 #pragma acc parallel dtype(*,ident)
1061 // expected-error@+1{{expected identifier}}
1062 #pragma acc parallel device_type(ident, *)
1064 // expected-error@+1{{expected identifier}}
1065 #pragma acc parallel dtype(ident, *)
1068 // expected-error@+1{{expected identifier}}
1069 #pragma acc parallel device_type("foo", 54)
1071 // expected-error@+1{{expected identifier}}
1072 #pragma acc parallel dtype(31, "bar")
1075 #pragma acc parallel device_type(ident, auto, int, float)
1077 #pragma acc parallel dtype(ident, auto, int, float)
1080 #pragma acc parallel device_type(ident, auto, int, float) dtype(ident, auto, int, float)
1084 #define acc_async_sync -1
1085 void AsyncArgument() {
1086 #pragma acc parallel async
1089 // expected-error@+1{{expected expression}}
1090 #pragma acc parallel async()
1093 // expected-error@+1{{use of undeclared identifier 'invalid'}}
1094 #pragma acc parallel async(invalid)
1097 // expected-error@+2{{expected ')'}}
1098 // expected-note@+1{{to match this '('}}
1099 #pragma acc parallel async(4, 3)
1102 #pragma acc parallel async(returns_int())
1105 #pragma acc parallel async(5)
1108 #pragma acc parallel async(acc_async_sync)
1112 void Tile() {
1114 int* Foo;
1115 // expected-error@+1{{expected '('}}
1116 #pragma acc loop tile
1117 for(int i = 0; i < 5;++i) {}
1118 // expected-error@+3{{expected expression}}
1119 // expected-error@+2{{expected ')'}}
1120 // expected-note@+1{{to match this '('}}
1121 #pragma acc loop tile(
1122 for(int i = 0; i < 5;++i) {}
1123 // expected-error@+1{{expected expression}}
1124 #pragma acc loop tile()
1125 for(int i = 0; i < 5;++i) {}
1126 // expected-error@+3{{expected expression}}
1127 // expected-error@+2{{expected ')'}}
1128 // expected-note@+1{{to match this '('}}
1129 #pragma acc loop tile(,
1130 for(int i = 0; i < 5;++i) {}
1131 // expected-error@+1{{expected expression}}
1132 #pragma acc loop tile(,)
1133 for(int i = 0; i < 5;++i) {}
1134 // expected-error@+1{{use of undeclared identifier 'invalid'}}
1135 #pragma acc loop tile(returns_int(), *, invalid, *)
1136 for(int i = 0; i < 5;++i) {}
1138 // expected-error@+1{{expected expression}}
1139 #pragma acc loop tile(returns_int() *, Foo, *)
1140 for(int i = 0; i < 5;++i) {}
1142 // expected-error@+1{{indirection requires pointer operand ('int' invalid)}}
1143 #pragma acc loop tile(* returns_int() , *)
1144 for(int j = 0; j < 5;++j){
1145 for(int i = 0; i < 5;++i);
1148 #pragma acc loop tile(*)
1149 for(int i = 0; i < 5;++i) {}
1150 // expected-error@+1{{OpenACC 'tile' clause size expression must be an asterisk or a constant expression}}
1151 #pragma acc loop tile(*Foo, *Foo)
1152 for(int i = 0; i < 5;++i) {}
1153 #pragma acc loop tile(5)
1154 for(int i = 0; i < 5;++i) {}
1155 #pragma acc loop tile(*, 5)
1156 for(int j = 0; j < 5;++j){
1157 for(int i = 0; i < 5;++i);
1159 #pragma acc loop tile(5, *)
1160 for(int j = 0; j < 5;++j){
1161 for(int i = 0; i < 5;++i);
1163 #pragma acc loop tile(5, *, 3, *)
1164 for(int j = 0; j < 5;++j){
1165 for(int k = 0; k < 5;++k)
1166 for(int l = 0;l < 5;++l)
1167 for(int i = 0; i < 5;++i);
1171 void Gang() {
1172 #pragma acc loop gang
1173 for(int i = 0; i < 5;++i) {}
1174 // expected-error@+3{{expected expression}}
1175 // expected-error@+2{{expected ')'}}
1176 // expected-note@+1{{to match this '('}}
1177 #pragma acc loop gang(
1178 for(int i = 0; i < 5;++i) {}
1179 // expected-error@+1{{expected expression}}
1180 #pragma acc loop gang()
1181 for(int i = 0; i < 5;++i) {}
1183 // expected-error@+1{{expected expression}}
1184 #pragma acc loop gang(5, *)
1185 for(int i = 0; i < 5;++i) {}
1187 // expected-error@+1{{expected expression}}
1188 #pragma acc loop gang(*)
1189 for(int i = 0; i < 5;++i) {}
1191 // expected-error@+1{{expected expression}}
1192 #pragma acc loop gang(5, num:*)
1193 for(int i = 0; i < 5;++i) {}
1195 // expected-error@+1{{expected expression}}
1196 #pragma acc loop gang(num:5, *)
1197 for(int i = 0; i < 5;++i) {}
1199 // expected-error@+1{{expected expression}}
1200 #pragma acc loop gang(num:5, num:*)
1201 for(int i = 0; i < 5;++i) {}
1203 // expected-error@+1{{expected expression}}
1204 #pragma acc loop gang(num:*)
1205 for(int i = 0; i < 5;++i) {}
1207 #pragma acc loop gang(dim:2)
1208 for(int i = 0; i < 5;++i) {}
1210 // expected-error@+1{{expected expression}}
1211 #pragma acc loop gang(dim:5, dim:*)
1212 for(int i = 0; i < 5;++i) {}
1214 // expected-error@+1{{expected expression}}
1215 #pragma acc loop gang(dim:*)
1216 for(int i = 0; i < 5;++i) {}
1218 #pragma acc loop gang(static:*)
1219 for(int i = 0; i < 5;++i) {}
1221 // expected-error@+2{{OpenACC 'gang' clause may have at most one 'static' argument}}
1222 // expected-note@+1{{previous expression is here}}
1223 #pragma acc loop gang(static:*, static:5)
1224 for(int i = 0; i < 5;++i) {}
1226 #pragma acc kernels
1227 #pragma acc loop gang(static:*, 5)
1228 for(int i = 0; i < 5;++i) {}
1230 #pragma acc kernels
1231 #pragma acc loop gang(static:45, 5)
1232 for(int i = 0; i < 5;++i) {}
1234 // expected-error@+3{{expected expression}}
1235 // expected-error@+2{{expected ')'}}
1236 // expected-note@+1{{to match this '('}}
1237 #pragma acc loop gang(static:45,
1238 for(int i = 0; i < 5;++i) {}
1240 // expected-error@+2{{expected ')'}}
1241 // expected-note@+1{{to match this '('}}
1242 #pragma acc loop gang(static:45
1243 for(int i = 0; i < 5;++i) {}
1245 // expected-error@+3{{expected expression}}
1246 // expected-error@+2{{expected ')'}}
1247 // expected-note@+1{{to match this '('}}
1248 #pragma acc loop gang(static:*,
1249 for(int i = 0; i < 5;++i) {}
1251 // expected-error@+2{{expected ')'}}
1252 // expected-note@+1{{to match this '('}}
1253 #pragma acc loop gang(static:*
1254 for(int i = 0; i < 5;++i) {}
1256 // expected-error@+3{{expected expression}}
1257 // expected-error@+2{{expected ')'}}
1258 // expected-note@+1{{to match this '('}}
1259 #pragma acc loop gang(45,
1260 for(int i = 0; i < 5;++i) {}
1262 // expected-error@+2{{expected ')'}}
1263 // expected-note@+1{{to match this '('}}
1264 #pragma acc loop gang(45
1265 for(int i = 0; i < 5;++i) {}
1267 // expected-error@+3{{expected expression}}
1268 // expected-error@+2{{expected ')'}}
1269 // expected-note@+1{{to match this '('}}
1270 #pragma acc loop gang(num:45,
1271 for(int i = 0; i < 5;++i) {}
1273 // expected-error@+2{{expected ')'}}
1274 // expected-note@+1{{to match this '('}}
1275 #pragma acc loop gang(num:45
1276 for(int i = 0; i < 5;++i) {}
1278 // expected-error@+3{{expected expression}}
1279 // expected-error@+2{{expected ')'}}
1280 // expected-note@+1{{to match this '('}}
1281 #pragma acc loop gang(dim:45,
1282 for(int i = 0; i < 5;++i) {}
1284 // expected-error@+2{{expected ')'}}
1285 // expected-note@+1{{to match this '('}}
1286 #pragma acc loop gang(dim:45
1287 for(int i = 0; i < 5;++i) {}
1289 #pragma acc kernels
1290 #pragma acc loop gang(static:*, 5)
1291 for(int i = 0; i < 5;++i) {}
1293 // expected-error@+1{{argument to 'gang' clause dimension must be a constant expression}}
1294 #pragma acc loop gang(static:*, dim:returns_int())
1295 for(int i = 0; i < 5;++i) {}
1297 // expected-error@+2 2{{'num' argument on 'gang' clause is not permitted on an orphaned 'loop' construct}}
1298 // expected-error@+1{{argument to 'gang' clause dimension must be a constant expression}}
1299 #pragma acc loop gang(num: 32, static:*, dim:returns_int(), 5)
1300 for(int i = 0; i < 5;++i) {}
1304 // expected-warning@+5{{OpenACC clause 'worker' not yet implemented, clause ignored}}
1305 // expected-warning@+4{{OpenACC clause 'vector' not yet implemented, clause ignored}}
1306 // expected-warning@+3{{OpenACC clause 'seq' not yet implemented, clause ignored}}
1307 // expected-warning@+2{{OpenACC clause 'nohost' not yet implemented, clause ignored}}
1308 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
1309 #pragma acc routine worker, vector, seq, nohost
1310 void bar();
1312 // expected-warning@+5{{OpenACC clause 'worker' not yet implemented, clause ignored}}
1313 // expected-warning@+4{{OpenACC clause 'vector' not yet implemented, clause ignored}}
1314 // expected-warning@+3{{OpenACC clause 'seq' not yet implemented, clause ignored}}
1315 // expected-warning@+2{{OpenACC clause 'nohost' not yet implemented, clause ignored}}
1316 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
1317 #pragma acc routine(bar) worker, vector, seq, nohost
1320 // Bind Clause Parsing.
1322 // expected-error@+2{{expected '('}}
1323 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
1324 #pragma acc routine bind
1325 void BCP1();
1327 // expected-error@+2{{expected identifier or string literal}}
1328 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
1329 #pragma acc routine(BCP1) bind()
1331 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
1332 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
1333 #pragma acc routine bind("ReductionClauseParsing")
1334 void BCP2();
1336 // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
1337 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
1338 #pragma acc routine(BCP1) bind(BCP2)
1340 // expected-error@+2{{use of undeclared identifier 'unknown_thing'}}
1341 // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
1342 #pragma acc routine(BCP1) bind(unknown_thing)