[flang-commits] [flang] [flang][test] Recognize !$acc and !$omp spelled with capital letters (PR #118666)

Krzysztof Parzyszek via flang-commits flang-commits at lists.llvm.org
Wed Dec 4 09:05:43 PST 2024


https://github.com/kparzysz created https://github.com/llvm/llvm-project/pull/118666

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.

>From ed9457c9e55620cf8675e399a7b23e59428fabe4 Mon Sep 17 00:00:00 2001
From: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
Date: Wed, 4 Dec 2024 10:40:25 -0600
Subject: [PATCH] [flang][test] Recognize !$acc and !$omp spelled with capital
 letters

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.
---
 flang/test/Semantics/test_symbols.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
 



More information about the flang-commits mailing list