[llvm] [UpdateTestChecks] Don't fail silently when conflicting CHECK lines means no checks are generated for some functions (PR #159321)
Alex Bradbury via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 23 08:29:15 PDT 2025
================
@@ -918,14 +919,51 @@ def __init__(self, run_list, flags, scrubber_args, path, ginfo):
self._global_var_dict.update({prefix: dict()})
def finish_and_get_func_dict(self):
- for prefix in self.get_failed_prefixes():
- warn(
- "Prefix %s had conflicting output from different RUN lines for all functions in test %s"
- % (
- prefix,
- self._path,
+ all_funcs = set()
+ for prefix in self._func_dict:
+ all_funcs.update(self._func_dict[prefix].keys())
+
+ warnings_to_print = collections.defaultdict(list)
+ for func in sorted(list(all_funcs)):
+ for i, run_info in enumerate(self._run_list):
+ prefixes = run_info[0]
+ if not prefixes:
+ continue
+
+ # Check if this RUN line produces this function at all.
+ run_contains_func = True
+ for p in prefixes:
+ if func not in self._func_dict.get(p, {}):
+ run_contains_func = False
+ break
----------------
asb wrote:
I've extended the comment to hopefully clarify, and also added a test case that captures this behaviour. When I thought about potential corner cases that could produce a false positive, this is the one that came to mind. Without this logic we do seem to produce a confusing warning for the `--included-generated-funcs` test case I committed. Possibly there are still cases with non-matching sets of functions and prefix clashes we would want to error, but it's not clear to me what behaviour is right. Either way, I think this patch is a strict improvement even if it's possible there are corner cases like this where _maybe_ you want even more error checking.
https://github.com/llvm/llvm-project/pull/159321
More information about the llvm-commits
mailing list