diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/Basic/OpenACCKinds.h | 28 | ||||
-rw-r--r-- | clang/lib/Parse/ParseOpenACC.cpp | 10 | ||||
-rw-r--r-- | clang/test/ParserOpenACC/parse-constructs.c | 58 |
3 files changed, 96 insertions, 0 deletions
diff --git a/clang/include/clang/Basic/OpenACCKinds.h b/clang/include/clang/Basic/OpenACCKinds.h index 79780b7..8da02b9 100644 --- a/clang/include/clang/Basic/OpenACCKinds.h +++ b/clang/include/clang/Basic/OpenACCKinds.h @@ -21,6 +21,34 @@ namespace clang { enum class OpenACCDirectiveKind { // Compute Constructs. Parallel, + Serial, + Kernels, + + // Data Environment. + Data, + // FIXME: 'enter data', 'exit data'. + HostData, + + // Misc. + Loop, + // FIXME: 'cache' + + // FIXME: Combined Constructs. + + // FIXME: atomic Construct variants. + + // Declare Directive. + Declare, + + // Executable Directives. "wait" is first referred to here, but ends up being + // in its own section after "routine". + Init, + Shutdown, + Set, + Update, + // FIXME: wait construct. + + // FIXME: routine construct. // Invalid. Invalid, diff --git a/clang/lib/Parse/ParseOpenACC.cpp b/clang/lib/Parse/ParseOpenACC.cpp index 9f13aad..ba29d75 100644 --- a/clang/lib/Parse/ParseOpenACC.cpp +++ b/clang/lib/Parse/ParseOpenACC.cpp @@ -26,6 +26,16 @@ namespace { OpenACCDirectiveKind GetOpenACCDirectiveKind(StringRef Name) { return llvm::StringSwitch<OpenACCDirectiveKind>(Name) .Case("parallel", OpenACCDirectiveKind::Parallel) + .Case("serial", OpenACCDirectiveKind::Serial) + .Case("kernels", OpenACCDirectiveKind::Kernels) + .Case("data", OpenACCDirectiveKind::Data) + .Case("host_data", OpenACCDirectiveKind::HostData) + .Case("loop", OpenACCDirectiveKind::Loop) + .Case("declare", OpenACCDirectiveKind::Declare) + .Case("init", OpenACCDirectiveKind::Init) + .Case("shutdown", OpenACCDirectiveKind::Shutdown) + .Case("set", OpenACCDirectiveKind::Shutdown) + .Case("update", OpenACCDirectiveKind::Update) .Default(OpenACCDirectiveKind::Invalid); } diff --git a/clang/test/ParserOpenACC/parse-constructs.c b/clang/test/ParserOpenACC/parse-constructs.c index 4c2188cc..e0607e7 100644 --- a/clang/test/ParserOpenACC/parse-constructs.c +++ b/clang/test/ParserOpenACC/parse-constructs.c @@ -13,4 +13,62 @@ void func() { // expected-warning@+2{{OpenACC clause parsing not yet implemented}} // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} #pragma acc parallel() clause list + for(;;){} + // expected-warning@+2{{OpenACC clause parsing not yet implemented}} + // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} +#pragma acc serial clause list + for(;;){} + // expected-warning@+2{{OpenACC clause parsing not yet implemented}} + // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} +#pragma acc kernels clause list + for(;;){} + // expected-warning@+2{{OpenACC clause parsing not yet implemented}} + // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} +#pragma acc data clause list + for(;;){} + // expected-warning@+2{{OpenACC clause parsing not yet implemented}} + // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} +#pragma acc host_data clause list + for(;;){} + // expected-warning@+2{{OpenACC clause parsing not yet implemented}} + // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} +#pragma acc loop clause list + for(;;){} + // expected-warning@+2{{OpenACC clause parsing not yet implemented}} + // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} +#pragma acc parallel invalid clause list + for(;;){} + // expected-warning@+2{{OpenACC clause parsing not yet implemented}} + // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} +#pragma acc parallel loop clause list + for(;;){} + // expected-warning@+2{{OpenACC clause parsing not yet implemented}} + // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} +#pragma acc serial loop clause list + for(;;){} + // expected-warning@+2{{OpenACC clause parsing not yet implemented}} + // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} +#pragma acc kernels loop clause list + for(;;){} + + // expected-warning@+2{{OpenACC clause parsing not yet implemented}} + // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} +#pragma acc declare clause list + for(;;){} + // expected-warning@+2{{OpenACC clause parsing not yet implemented}} + // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} +#pragma acc init clause list + for(;;){} + // expected-warning@+2{{OpenACC clause parsing not yet implemented}} + // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} +#pragma acc shutdown clause list + for(;;){} + // expected-warning@+2{{OpenACC clause parsing not yet implemented}} + // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} +#pragma acc set clause list + for(;;){} + // expected-warning@+2{{OpenACC clause parsing not yet implemented}} + // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} +#pragma acc update clause list + for(;;){} } |