Skip to content

Commit

Permalink
[OPENMP] Fix printing of array section with single index.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247389 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
alexey-bataev committed Sep 11, 2015
1 parent e8c9862 commit 75f325d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions lib/AST/StmtPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 << "]";
}

Expand Down
4 changes: 2 additions & 2 deletions test/OpenMP/task_ast_print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 75f325d

Please sign in to comment.