aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/UpdateTestChecks/common.py
diff options
context:
space:
mode:
authorTomer Shafir <tomer.shafir8@gmail.com>2025-08-12 11:44:42 +0300
committerGitHub <noreply@github.com>2025-08-12 11:44:42 +0300
commitd64e6b5e27f78fcf8fe5be4dfa2dcca0ad9af571 (patch)
tree6125235b0e0ccddf986ff710f5e04b4cfcb0c783 /llvm/utils/UpdateTestChecks/common.py
parent296e057d0bf29cb6ac30ce1aecd27c86017c4744 (diff)
downloadllvm-d64e6b5e27f78fcf8fe5be4dfa2dcca0ad9af571.zip
llvm-d64e6b5e27f78fcf8fe5be4dfa2dcca0ad9af571.tar.gz
llvm-d64e6b5e27f78fcf8fe5be4dfa2dcca0ad9af571.tar.bz2
[utils][UpdateTestChecks] Warn about possible target triple mismatch (#149645)
Aims to improve error reporting by printing a warning if the target function regex that has been selected finds no matches. For example, a `-mtriple=arm64-apple-darwin` runline, would map to the `arm64` prefix by `update_llc_test_checks.py` and wouldn't match Apple's function layout, generating some not understandable garbage checks. The implementation changes `common.process_run_line` to return an abstract indicator of number of functions processed, without breaking the drivers. Then `update_llc_test_checks.py` prints a driver specific error message.
Diffstat (limited to 'llvm/utils/UpdateTestChecks/common.py')
-rw-r--r--llvm/utils/UpdateTestChecks/common.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py
index 178c623..a5d4375 100644
--- a/llvm/utils/UpdateTestChecks/common.py
+++ b/llvm/utils/UpdateTestChecks/common.py
@@ -878,12 +878,17 @@ class FunctionTestBuilder:
return False
def process_run_line(self, function_re, scrubber, raw_tool_output, prefixes):
+ """
+ Returns the number of functions processed from the output by the regex.
+ """
build_global_values_dictionary(
self._global_var_dict, raw_tool_output, prefixes, self._ginfo
)
+ processed_func_count = 0
for m in function_re.finditer(raw_tool_output):
if not m:
continue
+ processed_func_count += 1
func = m.group("func")
body = m.group("body")
# func_name_separator is the string that is placed right after function name at the
@@ -1000,6 +1005,7 @@ class FunctionTestBuilder:
# preprocesser directives to exclude individual functions from some
# RUN lines.
self._func_dict[prefix][func] = None
+ return processed_func_count
def processed_prefixes(self, prefixes):
"""