[OpenACC] Add Compute Context Serialization test, fix a bug

While working on a followup patch, I discovered we didn't
serialize/deserialize the Compute Context properly, so this patch fixes
it, then adds a PCH mode to the ast test.
This commit is contained in:
erichkeane 2024-03-06 12:28:58 -08:00
parent abfac563f5
commit c54e0524ee
3 changed files with 11 additions and 2 deletions

View File

@ -2805,7 +2805,7 @@ void ASTStmtReader::VisitOpenACCAssociatedStmtConstruct(
void ASTStmtReader::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
VisitStmt(S);
VisitOpenACCConstructStmt(S);
VisitOpenACCAssociatedStmtConstruct(S);
}
//===----------------------------------------------------------------------===//

View File

@ -2855,7 +2855,7 @@ void ASTStmtWriter::VisitOpenACCAssociatedStmtConstruct(
void ASTStmtWriter::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
VisitStmt(S);
VisitOpenACCConstructStmt(S);
VisitOpenACCAssociatedStmtConstruct(S);
Code = serialization::STMT_OPENACC_COMPUTE_CONSTRUCT;
}

View File

@ -1,5 +1,12 @@
// RUN: %clang_cc1 %s -fopenacc -ast-dump | FileCheck %s
// Test this with PCH.
// RUN: %clang_cc1 %s -fopenacc -emit-pch -o %t %s
// RUN: %clang_cc1 %s -fopenacc -include-pch %t -ast-dump-all | FileCheck %s
#ifndef PCH_HELPER
#define PCH_HELPER
void NormalFunc() {
// FIXME: Add a test once we have clauses for this.
// CHECK-LABEL: NormalFunc
@ -104,3 +111,5 @@ struct S {
void use() {
TemplFunc<S>();
}
#endif