aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/UpdateTestChecks/asm.py
diff options
context:
space:
mode:
authorAlex Richardson <alexrichardson@google.com>2022-05-12 10:21:55 +0000
committerAlex Richardson <alexrichardson@google.com>2022-05-14 14:15:37 +0000
commit37a68497f1176cab3b2100c3bcb861e063cfaead (patch)
treefab2f872a3d00e531d9778acbc6db76f26f0e60b /llvm/utils/UpdateTestChecks/asm.py
parentf421659286af9ae2d4f01cd1f829832fb5c2bc8b (diff)
downloadllvm-37a68497f1176cab3b2100c3bcb861e063cfaead.zip
llvm-37a68497f1176cab3b2100c3bcb861e063cfaead.tar.gz
llvm-37a68497f1176cab3b2100c3bcb861e063cfaead.tar.bz2
[update_llc_test_checks] Use FileCheck captures for MCInst/MCReg output
To avoid test churn when backends add/rename new instructions/registers, it makes sense to use FileCheck captures for the exact MCInst/Reg number. This is motivated by D125307, where I use --asm-show-inst to differentiate the output for multiple instructions with the same mnemonic. This does not quite fix the churn issue yet: While files with the generated checks will be immune to the numbers changing, the update script test still suffers from this problem since the number is encoded in the FileCheck variable name. I plan to address this in a follow-up patch. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D125307
Diffstat (limited to 'llvm/utils/UpdateTestChecks/asm.py')
-rw-r--r--llvm/utils/UpdateTestChecks/asm.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index 5b6e7e2..a00a817 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -423,9 +423,8 @@ def scrub_asm_nvptx(asm, args):
asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm)
return asm
-
# Returns a tuple of a scrub function and a function regex. Scrub function is
-# used to alter function body in some way, for example, remove traling spaces.
+# used to alter function body in some way, for example, remove trailing spaces.
# Function regex is used to match function name, body, etc. in raw llc output.
def get_run_handler(triple):
target_handlers = {
@@ -482,10 +481,9 @@ def get_run_handler(triple):
##### Generator of assembly CHECK lines
def add_checks(output_lines, comment_marker, prefix_list, func_dict,
- func_name, is_filtered):
+ func_name, global_vars_seen_dict, is_filtered):
# Label format is based on ASM string.
check_label_format = '{} %s-LABEL: %s%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, is_filtered = is_filtered)
+ global_vars_seen_dict, is_filtered=is_filtered)