diff --git a/flang/lib/Parser/unparse.cpp b/flang/lib/Parser/unparse.cpp index 69e1d994a17e1..d86049886fc32 100644 --- a/flang/lib/Parser/unparse.cpp +++ b/flang/lib/Parser/unparse.cpp @@ -1890,10 +1890,8 @@ class UnparseVisitor { } void Unparse(const AccBindClause &x) { common::visit(common::visitors{ - [&](const Name &y) { Put('('), Walk(y), Put(')'); }, - [&](const ScalarDefaultCharExpr &y) { - Put('('), Walk(y), Put(')'); - }, + [&](const Name &y) { Walk(y); }, + [&](const ScalarDefaultCharExpr &y) { Walk(y); }, }, x.u); } diff --git a/flang/test/Parser/acc-unparse.f90 b/flang/test/Parser/acc-unparse.f90 index fdc0218a551f6..e0a6c164f0de1 100644 --- a/flang/test/Parser/acc-unparse.f90 +++ b/flang/test/Parser/acc-unparse.f90 @@ -76,3 +76,13 @@ subroutine acc_loop() ! CHECK: !$ACC LOOP GANG(STATIC:gangstatic,DIM:gangdim) end subroutine + +subroutine routine1() + !$acc routine bind("routine1_") +! CHECK: !$ACC ROUTINE BIND("routine1_") +end subroutine + +subroutine routine2() + !$acc routine(routine2) bind(routine2) +! CHECK: !$ACC ROUTINE(routine2) BIND(routine2) +end subroutine