aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/UpdateTestChecks/asm.py
diff options
context:
space:
mode:
authorDavid Greene <david.greene@cerebras.net>2022-01-19 09:33:17 -0800
committerDavid Greene <david.greene@cerebras.net>2022-01-28 14:08:07 -0800
commit030f71698d52f228929da5e3148602f4a3daff7d (patch)
tree3fe1520792027949ce220c83d2c667b82ddc4675 /llvm/utils/UpdateTestChecks/asm.py
parente1a12767ee628e179efc8733449f98018a686b4d (diff)
downloadllvm-030f71698d52f228929da5e3148602f4a3daff7d.zip
llvm-030f71698d52f228929da5e3148602f4a3daff7d.tar.gz
llvm-030f71698d52f228929da5e3148602f4a3daff7d.tar.bz2
[UpdateTestChecks] Add --filter and --filter-out options
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)