Skip to content

Commit

Permalink
[OpenACC] Fix ast-print of device_type clause
Browse files Browse the repository at this point in the history
When writing the test for this I seemingly forgot to put 'CHECK' on the
lines, so I didn't notice that I was printing the identifiers as
pointers rather than their names.  This patch corrects the tests and the
print behavior.
  • Loading branch information
erichkeane committed May 14, 2024
1 parent 1aff294 commit 03eba20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion clang/lib/AST/OpenACCClause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ void OpenACCClausePrinter::VisitDeviceTypeClause(
if (Arch.first == nullptr)
OS << "*";
else
OS << Arch.first;
OS << Arch.first->getName();
});
OS << ")";
}
10 changes: 5 additions & 5 deletions clang/test/AST/ast-print-openacc-compute-construct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,23 +111,23 @@ void foo() {
bool SomeB;
struct SomeStruct{} SomeStructImpl;

//#pragma acc parallel dtype(SomeB)
//CHECK: #pragma acc parallel dtype(SomeB)
#pragma acc parallel dtype(SomeB)
while(true);

//#pragma acc parallel device_type(SomeStruct)
//CHECK: #pragma acc parallel device_type(SomeStruct)
#pragma acc parallel device_type(SomeStruct)
while(true);

//#pragma acc parallel device_type(int)
//CHECK: #pragma acc parallel device_type(int)
#pragma acc parallel device_type(int)
while(true);

//#pragma acc parallel dtype(bool)
//CHECK: #pragma acc parallel dtype(bool)
#pragma acc parallel dtype(bool)
while(true);

//#pragma acc parallel device_type (SomeStructImpl)
//CHECK: #pragma acc parallel device_type(SomeStructImpl)
#pragma acc parallel device_type (SomeStructImpl)
while(true);
}
Expand Down

0 comments on commit 03eba20

Please sign in to comment.