Skip to content

[flang][test] Recognize !$acc and !$omp spelled with capital letters #118666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

kparzysz
Copy link
Contributor

@kparzysz kparzysz commented Dec 4, 2024

If there are any continuation lines in the source, they will be printed by the unparser with capital letters (at least in case of OpenMP). To avoid having them stripped out, recognize their spellings using capital letters as well.

If there are any continuation lines in the source, they will be printed
using capital letters (at least in case of OpenMP). To avoid having them
stripped out, recognize their spellings using capital letters as well.
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:semantics labels Dec 4, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 4, 2024

@llvm/pr-subscribers-flang-semantics

Author: Krzysztof Parzyszek (kparzysz)

Changes

If there are any continuation lines in the source, they will be printed using capital letters (at least in case of OpenMP). To avoid having them stripped out, recognize their spellings using capital letters as well.


Full diff: https://github.com/llvm/llvm-project/pull/118666.diff

1 Files Affected:

  • (modified) flang/test/Semantics/test_symbols.py (+1-1)
diff --git a/flang/test/Semantics/test_symbols.py b/flang/test/Semantics/test_symbols.py
index 24dc5004a42293..98f3b61e78b949 100755
--- a/flang/test/Semantics/test_symbols.py
+++ b/flang/test/Semantics/test_symbols.py
@@ -29,7 +29,7 @@
 # Strips out blank lines and all comments except for "!DEF:", "!REF:", "!$acc" and "!$omp"
 with open(src, "r") as text_in:
     for line in text_in:
-        text = re.sub(r"!(?![DR]EF:|\$omp|\$acc).*", "", line)
+        text = re.sub(r"!(?![DR]EF:|\$[Oo][Mm][Pp]|\$[Aa][Cc][Cc]).*", "", line)
         text = re.sub(r"^\s*$", "", text)
         diff1 += text
 

Copy link
Member

@Meinersbur Meinersbur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are any continuation lines in the source, they will be printed using capital letters (at least in case of OpenMP).

Who/what is printing them?

@kparzysz
Copy link
Contributor Author

kparzysz commented Dec 5, 2024

Who/what is printing them?

The unparser. I haven't dug too deep into it, I'm not sure why the first lines of the OpenMP directives are printed in lowercase for example, but if the line becomes too long it will show something like this in the output:

!$omp target distribute paral$
!$OMP lel

Copy link
Member

@Meinersbur Meinersbur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unparser.

Could that be included in the summary/commit message?

@kparzysz
Copy link
Contributor Author

kparzysz commented Dec 5, 2024

Could that be included in the summary/commit message?

Updated the commit description (it will become the commit message).

@kparzysz kparzysz merged commit da6099c into llvm:main Dec 5, 2024
8 checks passed
@kparzysz kparzysz deleted the users/kparzysz/test-symbols-case branch December 5, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:semantics flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants