File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ OpenACCDirectiveKind ParseOpenACCDirectiveKind(Parser &P) {
206
206
207
207
// Just #pragma acc can get us immediately to the end, make sure we don't
208
208
// introspect on the spelling before then.
209
- if (FirstTok.isAnnotation ( )) {
209
+ if (FirstTok.isNot (tok::identifier )) {
210
210
P.Diag (FirstTok, diag::err_acc_missing_directive);
211
211
return OpenACCDirectiveKind::Invalid;
212
212
}
@@ -224,11 +224,8 @@ OpenACCDirectiveKind ParseOpenACCDirectiveKind(Parser &P) {
224
224
if (ExDirKind >= OpenACCDirectiveKindEx::Invalid) {
225
225
switch (ExDirKind) {
226
226
case OpenACCDirectiveKindEx::Invalid: {
227
- if (!FirstTok.is (tok::identifier))
228
- P.Diag (FirstTok, diag::err_expected) << tok::identifier;
229
- else
230
- P.Diag (FirstTok, diag::err_acc_invalid_directive)
231
- << 0 << FirstTok.getIdentifierInfo ();
227
+ P.Diag (FirstTok, diag::err_acc_invalid_directive)
228
+ << 0 << FirstTok.getIdentifierInfo ();
232
229
return OpenACCDirectiveKind::Invalid;
233
230
}
234
231
case OpenACCDirectiveKindEx::Enter:
Original file line number Diff line number Diff line change @@ -7,6 +7,17 @@ void func() {
7
7
#pragma acc
8
8
for (;;){}
9
9
10
+ // expected-error@+4{{expected OpenACC directive}}
11
+ // expected-error@+3{{expected clause-list or newline in OpenACC directive}}
12
+ // expected-warning@+2{{OpenACC clause parsing not yet implemented}}
13
+ // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
14
+ #pragma acc(whatever) routine
15
+
16
+ // expected-error@+3{{expected OpenACC directive}}
17
+ // expected-warning@+2{{OpenACC clause parsing not yet implemented}}
18
+ // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
19
+ #pragma acc) routine
20
+
10
21
// expected-error@+2{{invalid OpenACC directive 'invalid'}}
11
22
// expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}}
12
23
#pragma acc invalid
You can’t perform that action at this time.
0 commit comments