[flang-commits] [flang] [flang][openMP] skip CompilerDirective on ResolveOmpTopLevelParts. (PR #69580)

via flang-commits flang-commits at lists.llvm.org
Thu Oct 19 02:57:54 PDT 2023


https://github.com/Z572 created https://github.com/llvm/llvm-project/pull/69580

Fixes #68966

should i copy and adjust flang/test/Semantics/ignore_tkr01.f90 to flang/test/Semantics/OpenMP/ignore_tkr01.f90 or just write a simple test for this case?

`flang-new -fopenmp fail.f90`

fail.f90:
``` 
!dir$ ignore_tkr
program main
end program main
```

>From dd756945667eafa8a3071a8f95248feca5b17e76 Mon Sep 17 00:00:00 2001
From: Zheng Junjie <zhengjunjie at iscas.ac.cn>
Date: Thu, 19 Oct 2023 13:50:26 +0800
Subject: [PATCH] [flang][openMP] skip CompilerDirective on
 ResolveOmpTopLevelParts.

---
 flang/lib/Semantics/resolve-directives.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp
index e8448a36a7b273c..355d5ede3f54ab7 100644
--- a/flang/lib/Semantics/resolve-directives.cpp
+++ b/flang/lib/Semantics/resolve-directives.cpp
@@ -2228,7 +2228,9 @@ void ResolveOmpTopLevelParts(
       if (!std::holds_alternative<common::Indirection<parser::Module>>(
               unit.u) &&
           !std::holds_alternative<common::Indirection<parser::Submodule>>(
-              unit.u)) {
+              unit.u) &&
+          !std::holds_alternative<
+              common::Indirection<parser::CompilerDirective>>(unit.u)) {
         Symbol *symbol{common::visit(
             [&context](auto &x) {
               Scope *scope = GetScope(context, x.value());



More information about the flang-commits mailing list