aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/UpdateTestChecks/asm.py
diff options
context:
space:
mode:
authorDavid Greene <david.greene@cerebras.net>2022-01-31 07:06:08 -0800
committerDavid Greene <david.greene@cerebras.net>2022-01-31 13:11:40 -0800
commitecd46edd613433154b3d0eeb25af27234f6f98eb (patch)
tree79576b912d84afed9b147e2403a94a2979c3bedb /llvm/utils/UpdateTestChecks/asm.py
parente21f90dba28c97538bfece3385e3b7616bd25730 (diff)
downloadllvm-ecd46edd613433154b3d0eeb25af27234f6f98eb.zip
llvm-ecd46edd613433154b3d0eeb25af27234f6f98eb.tar.gz
llvm-ecd46edd613433154b3d0eeb25af27234f6f98eb.tar.bz2
[UpdateTestChecks] Re-add --filter and --filter-out options
Re-add filtering options with fixes for failed tests. We were not passing the is_filtered argument in all check generator calls in update_cc_test_checks.py Enhance the various update_*_test_checks.py tools to allow filtering the tool output with regular expressions. The --filter option will emit only tool output lines matching the given regular expression while the --filter-out option will emit only tools output lines not matching the given regular expression. Filters are applied in order of appearance on the command line (or in UTC_ARGS) and the first matching filter terminates the search. This allows test authors to create more focused tests by removing irrelevant tool output and checking only the pieces of output necessary to test the desired functionality. Differential Revision: https://reviews.llvm.org/D117694
Diffstat (limited to 'llvm/utils/UpdateTestChecks/asm.py')
-rw-r--r--llvm/utils/UpdateTestChecks/asm.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index c24849b..95d17ba 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -456,8 +456,11 @@ def get_run_handler(triple):
##### Generator of assembly CHECK lines
-def add_asm_checks(output_lines, comment_marker, prefix_list, func_dict, func_name):
+def add_asm_checks(output_lines, comment_marker, prefix_list, func_dict,
+ func_name, is_filtered):
# Label format is based on ASM string.
check_label_format = '{} %s-LABEL: %s%s:'.format(comment_marker)
global_vars_seen_dict = {}
- common.add_checks(output_lines, comment_marker, prefix_list, func_dict, func_name, check_label_format, True, False, global_vars_seen_dict)
+ common.add_checks(output_lines, comment_marker, prefix_list, func_dict,
+ func_name, check_label_format, True, False,
+ global_vars_seen_dict, is_filtered = is_filtered)