-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Fix regular expression to guard against a repeating version string #84575
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
base: main
Are you sure you want to change the base?
Conversation
@llvm/pr-subscribers-testing-tools Author: Wolfgang Pieb (wolfy1961) ChangesA recent change d6c2cbbc651 causes the test Making the expression preceding "\w+ version" non-greedy fix this. Unfortunately there is no simple way to generate a test case, since it would require a change in the clang version string. Full diff: https://github.com/llvm/llvm-project/pull/84575.diff 1 Files Affected:
diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py
index ecb19d233a8d1a..85b4bdd2c6dc7a 100644
--- a/llvm/utils/UpdateTestChecks/common.py
+++ b/llvm/utils/UpdateTestChecks/common.py
@@ -2189,7 +2189,7 @@ def add(var):
METADATA_FILTERS = [
(
- r"(?<=\")(.+ )?(\w+ version )[\d.]+(?:[^\" ]*)(?: \([^)]+\))?",
+ r"(?<=\")(.+ )??(\w+ version )[\d.]+(?:[^\" ]*)(?: \([^)]+\))?",
r"{{.*}}\2{{.*}}",
), # preface with glob also, to capture optional CLANG_VENDOR
(r'(!DIFile\(filename: ".+", directory: )".+"', r"\1{{.*}}"),
|
Would it be possible to write a LLVM IR test for update_test_checks.py with pre-existing metadata? Or do we only scrub it for update_cc_test_checks.py? |
d5de1b4
to
9ec7462
Compare
Sorry for the long delay. |
Rebased. Ping ... |
48686a1
to
bee12aa
Compare
Rebased. Disappeared from the radar for some reason. |
A recent change d6c2cbbc651 causes the test
clang/test/utils/update_cc_test_checks/generated-funcs.test
to fail for compilers with version strings that repeat the sequence "version", such asclang version 19.0.0 (myvendor clang version 4.0.0)
.Making the expression preceding "\w+ version" non-greedy fix this.
Unfortunately there is no simple way to generate a test case, since it would require a change in the clang version string.