Skip to content

Commit c54e052

Browse files
committed
[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.
1 parent abfac56 commit c54e052

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

clang/lib/Serialization/ASTReaderStmt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2805,7 +2805,7 @@ void ASTStmtReader::VisitOpenACCAssociatedStmtConstruct(
28052805

28062806
void ASTStmtReader::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
28072807
VisitStmt(S);
2808-
VisitOpenACCConstructStmt(S);
2808+
VisitOpenACCAssociatedStmtConstruct(S);
28092809
}
28102810

28112811
//===----------------------------------------------------------------------===//

clang/lib/Serialization/ASTWriterStmt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2855,7 +2855,7 @@ void ASTStmtWriter::VisitOpenACCAssociatedStmtConstruct(
28552855

28562856
void ASTStmtWriter::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
28572857
VisitStmt(S);
2858-
VisitOpenACCConstructStmt(S);
2858+
VisitOpenACCAssociatedStmtConstruct(S);
28592859
Code = serialization::STMT_OPENACC_COMPUTE_CONSTRUCT;
28602860
}
28612861

clang/test/SemaOpenACC/compute-construct-ast.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
// RUN: %clang_cc1 %s -fopenacc -ast-dump | FileCheck %s
22

3+
// Test this with PCH.
4+
// RUN: %clang_cc1 %s -fopenacc -emit-pch -o %t %s
5+
// RUN: %clang_cc1 %s -fopenacc -include-pch %t -ast-dump-all | FileCheck %s
6+
7+
#ifndef PCH_HELPER
8+
#define PCH_HELPER
9+
310
void NormalFunc() {
411
// FIXME: Add a test once we have clauses for this.
512
// CHECK-LABEL: NormalFunc
@@ -104,3 +111,5 @@ struct S {
104111
void use() {
105112
TemplFunc<S>();
106113
}
114+
#endif
115+

0 commit comments

Comments
 (0)