[flang-commits] [flang] e2f6891 - [flang][openacc] Fix name resolution on routine bind clause

Valentin Clement via flang-commits flang-commits at lists.llvm.org
Wed Aug 16 15:12:41 PDT 2023


Author: Valentin Clement
Date: 2023-08-16T15:12:36-07:00
New Revision: e2f689155150f9a60586329780cb2b90b859c029

URL: https://github.com/llvm/llvm-project/commit/e2f689155150f9a60586329780cb2b90b859c029
DIFF: https://github.com/llvm/llvm-project/commit/e2f689155150f9a60586329780cb2b90b859c029.diff

LOG: [flang][openacc] Fix name resolution on routine bind clause

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D158120

Added: 
    

Modified: 
    flang/lib/Semantics/resolve-directives.cpp
    flang/test/Semantics/OpenACC/acc-routine.f90

Removed: 
    


################################################################################
diff  --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp
index 2ecdfca18c6b49..69cd6930c3cf70 100644
--- a/flang/lib/Semantics/resolve-directives.cpp
+++ b/flang/lib/Semantics/resolve-directives.cpp
@@ -846,7 +846,7 @@ bool AccAttributeVisitor::Pre(const parser::OpenACCRoutineConstruct &x) {
 
 bool AccAttributeVisitor::Pre(const parser::AccBindClause &x) {
   if (const auto *name{std::get_if<parser::Name>(&x.u)}) {
-    if (!ResolveName(*name)) {
+    if (!ResolveName(*name, true)) {
       context_.Say(name->source,
           "No function or subroutine declared for '%s'"_err_en_US,
           name->source);

diff  --git a/flang/test/Semantics/OpenACC/acc-routine.f90 b/flang/test/Semantics/OpenACC/acc-routine.f90
index f6176dd9c2f3e8..4dcb849c642c83 100644
--- a/flang/test/Semantics/OpenACC/acc-routine.f90
+++ b/flang/test/Semantics/OpenACC/acc-routine.f90
@@ -9,3 +9,7 @@ subroutine sub2(a)
   real, dimension(10) :: a
   call sub1(a)
 end subroutine
+
+subroutine sub3()
+  !$acc routine bind(sub1)
+end subroutine


        


More information about the flang-commits mailing list