aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/UpdateTestChecks/asm.py
diff options
context:
space:
mode:
authorJohannes Doerfert <johannes@jdoerfert.de>2020-08-10 13:59:07 -0500
committerJohannes Doerfert <johannes@jdoerfert.de>2020-08-12 01:04:16 -0500
commit97ce7fd89fcc92d84c1938108388f735d55d372c (patch)
treee7b23c1da95a0fbacac77b1533d1175fc4504c89 /llvm/utils/UpdateTestChecks/asm.py
parent31e5f7120bdd2f76337686d9d169b1c00e6ee69c (diff)
downloadllvm-97ce7fd89fcc92d84c1938108388f735d55d372c.zip
llvm-97ce7fd89fcc92d84c1938108388f735d55d372c.tar.gz
llvm-97ce7fd89fcc92d84c1938108388f735d55d372c.tar.bz2
[UpdateTestChecks] Match unnamed values like "@[0-9]+" and "![0-9]+"
With this patch we will match most *uses* of "temporary" named things in the IR via regular expressions, not their name at creation time. The new "values" we match are: - "unnamed" globals: `@[0-9]+` - debug metadata: `!dbg ![0-9]+` - loop metadata: `!loop ![0-9]+` - tbaa metadata: `!tbaa ![0-9]+` - range metadata: `!range ![0-9]+` - generic metadata: `metadata ![0-9]+` - attributes groups: `#[0-9]` We still don't match the declarations but that can be done later. This patch can introduce churn when existing check lines contain the old hardcoded versions of the above "values". We can add a flag to opt-out, or opt-in, if necessary. Reviewed By: arichardson, MaskRay Differential Revision: https://reviews.llvm.org/D85099
Diffstat (limited to 'llvm/utils/UpdateTestChecks/asm.py')
-rw-r--r--llvm/utils/UpdateTestChecks/asm.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index cfcc8de..84db014 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -371,4 +371,5 @@ def build_function_body_dictionary_for_triple(args, raw_tool_output, triple, pre
def add_asm_checks(output_lines, comment_marker, prefix_list, func_dict, func_name):
# Label format is based on ASM string.
check_label_format = '{} %s-LABEL: %s%s:'.format(comment_marker)
- 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)