From e78b763568e47e685926614195c3075afa35668c Mon Sep 17 00:00:00 2001 From: Scott Linder Date: Thu, 24 Apr 2025 13:03:33 -0400 Subject: update_test_checks: Relax DIFile filename checks (#135692) Avoid baking in absolute paths in check lines generated for DIFile metadata. Generated test checks cannot be sensitive to absolute paths anyway, as those vary with the environment, but there could be situations where some sensitivity to partial paths is required for certain tests. This implementation just assumes such tests aren't worth the effort to support, but it could be supported in the future. This is most useful for update_cc_test_checks with debug info enabled, where the test writer cannot manipulate the paths within the generated IR directly. --- llvm/utils/UpdateTestChecks/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/utils/UpdateTestChecks/common.py') diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py index 274614c..e747ae3 100644 --- a/llvm/utils/UpdateTestChecks/common.py +++ b/llvm/utils/UpdateTestChecks/common.py @@ -2358,7 +2358,7 @@ METADATA_FILTERS = [ r"(?<=\")(.+ )?(\w+ version )[\d.]+(?:[^\" ]*)(?: \([^)]+\))?", r"{{.*}}\2{{.*}}", ), # preface with glob also, to capture optional CLANG_VENDOR - (r'(!DIFile\(filename: ".+", directory: )".+"', r"\1{{.*}}"), + (r'(!DIFile\(filename: ")(.+/)?([^/]+", directory: )".+"', r"\1{{.*}}\3{{.*}}"), ] METADATA_FILTERS_RE = [(re.compile(f), r) for (f, r) in METADATA_FILTERS] -- cgit v1.1