[Flang] remove whole-archive option for AIX linker (#76039)
[llvm-project.git] / clang / test / ParserOpenACC / parse-cache-construct.c
blob560f45423bc2b9a7bfdd201fdb12ed32a320eb0a
1 // RUN: %clang_cc1 %s -verify -fopenacc
3 char *getArrayPtr();
4 void func() {
5 char Array[10];
6 char *ArrayPtr = getArrayPtr();
7 int *readonly;
9 for (int i = 0; i < 10; ++i) {
10 // expected-error@+2{{expected '('}}
11 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
12 #pragma acc cache
15 for (int i = 0; i < 10; ++i) {
16 // expected-error@+3{{expected '('}}
17 // expected-error@+2{{invalid OpenACC clause 'clause'}}
18 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
19 #pragma acc cache clause list
22 for (int i = 0; i < 10; ++i) {
23 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
24 #pragma acc cache()
27 for (int i = 0; i < 10; ++i) {
28 // expected-error@+2{{invalid OpenACC clause 'clause'}}
29 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
30 #pragma acc cache() clause-list
33 for (int i = 0; i < 10; ++i) {
34 // expected-error@+3{{expected ')'}}
35 // expected-note@+2{{to match this '('}}
36 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
37 #pragma acc cache(
40 for (int i = 0; i < 10; ++i) {
41 // expected-error@+4{{use of undeclared identifier 'invalid'}}
42 // expected-error@+3{{expected ')'}}
43 // expected-note@+2{{to match this '('}}
44 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
45 #pragma acc cache(invalid
48 for (int i = 0; i < 10; ++i) {
49 // expected-error@+4{{expected '['}}
50 // expected-error@+3{{expected ')'}}
51 // expected-note@+2{{to match this '('}}
52 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
53 #pragma acc cache(ArrayPtr
56 for (int i = 0; i < 10; ++i) {
57 // expected-error@+2{{use of undeclared identifier 'invalid'}}
58 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
59 #pragma acc cache(invalid)
62 for (int i = 0; i < 10; ++i) {
63 // expected-error@+2{{expected '['}}
64 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
65 #pragma acc cache(ArrayPtr)
68 for (int i = 0; i < 10; ++i) {
69 // expected-error@+4{{expected expression}}
70 // expected-error@+3{{expected ')'}}
71 // expected-note@+2{{to match this '('}}
72 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
73 #pragma acc cache(ArrayPtr[
76 for (int i = 0; i < 10; ++i) {
77 // expected-error@+2{{expected expression}}
78 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
79 #pragma acc cache(ArrayPtr[, 5)
82 for (int i = 0; i < 10; ++i) {
83 // expected-error@+2{{expected expression}}
84 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
85 #pragma acc cache(Array[)
88 for (int i = 0; i < 10; ++i) {
89 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
90 #pragma acc cache(Array[*readonly])
93 for (int i = 0; i < 10; ++i) {
94 // expected-error@+4{{expected expression}}
95 // expected-error@+3{{expected ')'}}
96 // expected-note@+2{{to match this '('}}
97 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
98 #pragma acc cache(Array[*readonly:
101 for (int i = 0; i < 10; ++i) {
102 // expected-error@+2{{expected '['}}
103 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
104 #pragma acc cache(readonly)
107 for (int i = 0; i < 10; ++i) {
108 // expected-error@+2{{expected '['}}
109 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
110 #pragma acc cache(readonly:ArrayPtr)
113 for (int i = 0; i < 10; ++i) {
114 // expected-error@+2{{expected expression}}
115 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
116 #pragma acc cache(readonly:ArrayPtr[5:])
119 for (int i = 0; i < 10; ++i) {
120 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
121 #pragma acc cache(readonly:ArrayPtr[5:*readonly])
124 for (int i = 0; i < 10; ++i) {
125 // expected-error@+2{{expected '['}}
126 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
127 #pragma acc cache(readonly:ArrayPtr[5:*readonly], Array)
130 for (int i = 0; i < 10; ++i) {
131 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
132 #pragma acc cache(readonly:ArrayPtr[5:*readonly], Array[*readonly:3])
135 for (int i = 0; i < 10; ++i) {
136 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
137 #pragma acc cache(readonly:ArrayPtr[5 + i:*readonly], Array[*readonly + i:3])
140 for (int i = 0; i < 10; ++i) {
141 // expected-error@+4{{expected identifier}}
142 // expected-error@+3{{expected ')'}}
143 // expected-note@+2{{to match this '('}}
144 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
145 #pragma acc cache(readonly:ArrayPtr[5:*readonly],
148 for (int i = 0; i < 10; ++i) {
149 // expected-error@+2{{expected identifier}}
150 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
151 #pragma acc cache(readonly:ArrayPtr[5:*readonly],)
154 for (int i = 0; i < 10; ++i) {
155 // expected-warning@+2{{left operand of comma operator has no effect}}
156 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
157 #pragma acc cache(readonly:ArrayPtr[5,6:*readonly])
160 for (int i = 0; i < 10; ++i) {
161 // expected-warning@+2{{left operand of comma operator has no effect}}
162 // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
163 #pragma acc cache(readonly:ArrayPtr[5:3, *readonly], ArrayPtr[0])