[llvm] b1f55c3 - [UpdateTestUtils] Print test filename when complaining about conflicting prefix

Roman Lebedev via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 20 04:13:14 PDT 2021


Author: Roman Lebedev
Date: 2021-06-20T14:12:39+03:00
New Revision: b1f55c33d435ef8a68735774ea32f0252750ebcd

URL: https://github.com/llvm/llvm-project/commit/b1f55c33d435ef8a68735774ea32f0252750ebcd
DIFF: https://github.com/llvm/llvm-project/commit/b1f55c33d435ef8a68735774ea32f0252750ebcd.diff

LOG: [UpdateTestUtils] Print test filename when complaining about conflicting prefix

Now that FileCheck eagerly complains when prefixes are unused,
the update script does the same, and  is becoming very common
to need to drop some prefixes, yet figuring out the file
it complains about isn't obvious unless it actually tells us.

Added: 
    

Modified: 
    llvm/utils/UpdateTestChecks/common.py
    llvm/utils/update_analyze_test_checks.py
    llvm/utils/update_cc_test_checks.py
    llvm/utils/update_llc_test_checks.py
    llvm/utils/update_test_checks.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py
index 358a06daeb90b..80b0c847080c5 100644
--- a/llvm/utils/UpdateTestChecks/common.py
+++ b/llvm/utils/UpdateTestChecks/common.py
@@ -291,11 +291,12 @@ def __str__(self):
     return self.scrub
 
 class FunctionTestBuilder:
-  def __init__(self, run_list, flags, scrubber_args):
+  def __init__(self, run_list, flags, scrubber_args, path):
     self._verbose = flags.verbose
     self._record_args = flags.function_signature
     self._check_attributes = flags.check_attributes
     self._scrubber_args = scrubber_args
+    self._path = path
     # Strip double-quotes if input was read by UTC_ARGS
     self._replace_value_regex = list(map(lambda x: x.strip('"'), flags.replace_value_regex))
     self._func_dict = {}
@@ -309,7 +310,7 @@ def __init__(self, run_list, flags, scrubber_args):
 
   def finish_and_get_func_dict(self):
     for prefix in self._get_failed_prefixes():
-      warn('Prefix %s had conflicting output from 
diff erent RUN lines for all functions' % (prefix,))
+      warn('Prefix %s had conflicting output from 
diff erent RUN lines for all functions in test %s' % (prefix,self._path,))
     return self._func_dict
 
   def func_order(self):

diff  --git a/llvm/utils/update_analyze_test_checks.py b/llvm/utils/update_analyze_test_checks.py
index 2faa08d9244b9..6c5bc525b98a6 100755
--- a/llvm/utils/update_analyze_test_checks.py
+++ b/llvm/utils/update_analyze_test_checks.py
@@ -115,7 +115,8 @@ def main():
             'function_signature': False,
             'check_attributes': False,
             'replace_value_regex': []}),
-      scrubber_args = [])
+      scrubber_args = [],
+      path=test)
 
     for prefixes, opt_args in prefix_list:
       common.debug('Extracted opt cmd:', opt_basename, opt_args, file=sys.stderr)

diff  --git a/llvm/utils/update_cc_test_checks.py b/llvm/utils/update_cc_test_checks.py
index cbe58765f9fc2..068a9e439e45f 100755
--- a/llvm/utils/update_cc_test_checks.py
+++ b/llvm/utils/update_cc_test_checks.py
@@ -275,7 +275,8 @@ def main():
     builder = common.FunctionTestBuilder(
       run_list=filecheck_run_list,
       flags=ti.args,
-      scrubber_args=[])
+      scrubber_args=[],
+      path=ti.path)
 
     for prefixes, args, extra_commands, triple_in_cmd in run_list:
       # Execute non-filechecked runline.

diff  --git a/llvm/utils/update_llc_test_checks.py b/llvm/utils/update_llc_test_checks.py
index d5ff299b42322..7e20a58d6ea4a 100755
--- a/llvm/utils/update_llc_test_checks.py
+++ b/llvm/utils/update_llc_test_checks.py
@@ -114,7 +114,8 @@ def main():
             'function_signature': False,
             'check_attributes': False,
             'replace_value_regex': []}),
-        scrubber_args=[ti.args])
+        scrubber_args=[ti.args],
+        path=ti.path)
 
     for prefixes, llc_tool, llc_args, preprocess_cmd, triple_in_cmd, march_in_cmd in run_list:
       common.debug('Extracted LLC cmd:', llc_tool, llc_args)

diff  --git a/llvm/utils/update_test_checks.py b/llvm/utils/update_test_checks.py
index e240c6ca2e504..9ac95ccd80cde 100755
--- a/llvm/utils/update_test_checks.py
+++ b/llvm/utils/update_test_checks.py
@@ -113,7 +113,8 @@ def main():
     builder = common.FunctionTestBuilder(
       run_list=prefix_list,
       flags=ti.args,
-      scrubber_args=[])
+      scrubber_args=[],
+      path=ti.path)
 
     for prefixes, opt_args, preprocess_cmd in prefix_list:
       common.debug('Extracted opt cmd: ' + opt_basename + ' ' + opt_args)


        


More information about the llvm-commits mailing list