summaryrefslogtreecommitdiff
path: root/utils/update_llc_test_checks.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/update_llc_test_checks.py')
-rwxr-xr-xutils/update_llc_test_checks.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/update_llc_test_checks.py b/utils/update_llc_test_checks.py
index 4125ea981ec15..df01d8973c464 100755
--- a/utils/update_llc_test_checks.py
+++ b/utils/update_llc_test_checks.py
@@ -24,6 +24,7 @@ def llc(args, cmd_args, ir):
ASM_SCRUB_WHITESPACE_RE = re.compile(r'(?!^(| \w))[ \t]+', flags=re.M)
+ASM_SCRUB_TRAILING_WHITESPACE_RE = re.compile(r'[ \t]+$', flags=re.M)
ASM_SCRUB_SHUFFLES_RE = (
re.compile(
r'^(\s*\w+) [^#\n]+#+ ((?:[xyz]mm\d+|mem) = .*)$',
@@ -47,6 +48,8 @@ def scrub_asm(asm):
asm = ASM_SCRUB_RIP_RE.sub(r'{{.*}}(%rip)', asm)
# Strip kill operands inserted into the asm.
asm = ASM_SCRUB_KILL_COMMENT_RE.sub('', asm)
+ # Strip trailing whitespace.
+ asm = ASM_SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm)
return asm
@@ -66,7 +69,7 @@ def main():
asm_function_re = re.compile(
r'^_?(?P<f>[^:]+):[ \t]*#+[ \t]*@(?P=f)\n[^:]*?'
r'(?P<body>^##?[ \t]+[^:]+:.*?)\s*'
- r'^\s*(?:[^:\n]+?:\s*\n\s*\.size|\.cfi_endproc|\.globl|\.(?:sub)?section)',
+ r'^\s*(?:[^:\n]+?:\s*\n\s*\.size|\.cfi_endproc|\.globl|\.comm|\.(?:sub)?section)',
flags=(re.M | re.S))
check_prefix_re = re.compile('--check-prefix=(\S+)')
check_re = re.compile(r'^\s*;\s*([^:]+?)(?:-NEXT|-NOT|-DAG|-LABEL)?:')
@@ -122,6 +125,9 @@ def main():
continue
f = m.group('f')
f_asm = scrub_asm(m.group('body'))
+ if f.startswith('stress'):
+ # We only use the last line of the asm for stress tests.
+ f_asm = '\n'.join(f_asm.splitlines()[-1:])
if args.verbose:
print >>sys.stderr, 'Processing asm for function: ' + f
for l in f_asm.splitlines():