aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/update_test_checks.py
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-04-05 16:49:07 +0000
committerSanjay Patel <spatel@rotateright.com>2016-04-05 16:49:07 +0000
commit96241e78ede7470fca9a98b292f4b486a729c1c4 (patch)
treeceb5f15c57faf66beba73b8f813a0eeb02ea1a67 /llvm/utils/update_test_checks.py
parenta49c557f70ee86bdc149900ab080b9dea48241b6 (diff)
downloadllvm-96241e78ede7470fca9a98b292f4b486a729c1c4.zip
llvm-96241e78ede7470fca9a98b292f4b486a729c1c4.tar.gz
llvm-96241e78ede7470fca9a98b292f4b486a729c1c4.tar.bz2
check or check-next the first line of the function too
We could make this an option if people don't like it. But since part of the reason for using a script to generate checks is to prevent lazy checking that lets bugs crawl through, let's have the script check the first line too. For asm tests, it ensures that nothing unexpected has happened before the first line of asm. This matches the existing behavior of update_llc_test_checks.py. More discussion in PR22897: https://llvm.org/bugs/show_bug.cgi?id=22897 llvm-svn: 265414
Diffstat (limited to 'llvm/utils/update_test_checks.py')
-rwxr-xr-xllvm/utils/update_test_checks.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/llvm/utils/update_test_checks.py b/llvm/utils/update_test_checks.py
index 19b2785..9458273 100755
--- a/llvm/utils/update_test_checks.py
+++ b/llvm/utils/update_test_checks.py
@@ -186,15 +186,25 @@ def add_checks(output_lines, prefix_list, func_dict, func_name, tool_basename):
if tool_basename == "opt":
func_body = genericize_check_lines(func_body)
+ # This could be selectively enabled with an optional invocation argument.
+ # Disabled for now: better to check everything. Be safe rather than sorry.
+
# Handle the first line of the function body as a special case because
# it's often just noise (a useless asm comment or entry label).
- if func_body[0].startswith("#") or func_body[0].startswith("entry:"):
- is_blank_line = True
- else:
- output_lines.append('; %s: %s' % (checkprefix, func_body[0]))
+ #if func_body[0].startswith("#") or func_body[0].startswith("entry:"):
+ # is_blank_line = True
+ #else:
+ # output_lines.append('; %s: %s' % (checkprefix, func_body[0]))
+ # is_blank_line = False
+
+ # For llc tests, there may be asm directives between the label and the
+ # first checked line (most likely that first checked line is "# BB#0").
+ if tool_basename == "opt":
is_blank_line = False
+ else:
+ is_blank_line = True;
- for func_line in func_body[1:]:
+ for func_line in func_body:
if func_line.strip() == '':
is_blank_line = True
continue