[OPENMP] Fix printing of array section with single index.

llvm-svn: 247389
This commit is contained in:
Alexey Bataev 2015-09-11 04:54:28 +00:00
parent cf1baae6b8
commit ed5fb67ad1
2 changed files with 7 additions and 5 deletions

View File

@ -1300,9 +1300,11 @@ void StmtPrinter::VisitOMPArraySectionExpr(OMPArraySectionExpr *Node) {
OS << "[";
if (Node->getLowerBound())
PrintExpr(Node->getLowerBound());
OS << ":";
if (Node->getLength())
PrintExpr(Node->getLength());
if (Node->getColonLoc().isValid()) {
OS << ":";
if (Node->getLength())
PrintExpr(Node->getLength());
}
OS << "]";
}

View File

@ -87,8 +87,8 @@ int main(int argc, char **argv) {
#pragma omp threadprivate(a)
Enum ee;
// CHECK: Enum ee;
#pragma omp task untied mergeable depend(out:argv[1], (arr)[0:]) if(task: argc > 0)
// CHECK-NEXT: #pragma omp task untied mergeable depend(out : argv[1],(arr)[0:]) if(task: argc > 0)
#pragma omp task untied mergeable depend(out:argv[:a][1], (arr)[0:]) if(task: argc > 0)
// CHECK-NEXT: #pragma omp task untied mergeable depend(out : argv[:a][1],(arr)[0:]) if(task: argc > 0)
a = 2;
// CHECK-NEXT: a = 2;
#pragma omp task default(none), private(argc, b) firstprivate(argv) if (argc > 0) final(a > 0) depend(inout : a, argv[:argc],arr[:a])