[llvm] update_test_checks: Relax DIFile filename checks (PR #135692)
Scott Linder via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 17 09:43:29 PDT 2025
================
@@ -2358,7 +2358,7 @@ def add(var):
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{{.*}}"),
----------------
slinder1 wrote:
Yes, and in particular update_cc_test_checks.py seems to invoke clang in such a way as to always generate absolute paths.
The approach I took leaves some potential for ambiguity in some cases, but I think real issues would only crop up for largely contrived test cases (like having a test which depends on multiple input files at different relative paths but with the same filename) and even then the order of the metadata in the output should be stable, so it should be pretty inconsequential.
https://github.com/llvm/llvm-project/pull/135692
More information about the llvm-commits
mailing list