From ed9457c9e55620cf8675e399a7b23e59428fabe4 Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Wed, 4 Dec 2024 10:40:25 -0600 Subject: [PATCH 1/2] [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 24dc5004a4229..98f3b61e78b94 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 From 289daca3d5d96b307bb73a5547f2e9dcf1b8eca8 Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Thu, 5 Dec 2024 06:16:16 -0600 Subject: [PATCH 2/2] use re.I instead of [Xx] for each letter Co-authored-by: Michael Kruse --- 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 98f3b61e78b94..aca55acc8d402 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:|\$[Oo][Mm][Pp]|\$[Aa][Cc][Cc]).*", "", line) + text = re.sub(r"!(?![DR]EF:|\$omp|\$acc).*", "", line, re.I) text = re.sub(r"^\s*$", "", text) diff1 += text