aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/update_test_checks.py
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2016-06-11 20:39:21 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2016-06-11 20:39:21 +0000
commit2b7c02a04f465c298d008ebf8b7cc616e3d3db89 (patch)
tree720229c710710ef2dffb927b392c04dd102dcab3 /llvm/utils/update_test_checks.py
parent897711f018e9060186cc526b46fcb26ef6dca419 (diff)
downloadllvm-2b7c02a04f465c298d008ebf8b7cc616e3d3db89.zip
llvm-2b7c02a04f465c298d008ebf8b7cc616e3d3db89.tar.gz
llvm-2b7c02a04f465c298d008ebf8b7cc616e3d3db89.tar.bz2
[X86] Updated test checks script to generalise LCPI symbol refs
The script now replace '.LCPI888_8' style asm symbols with the {{\.LCPI.*}} re pattern - this helps stop hardcoded symbols in 32-bit x86 tests changing with every edit of the file Refreshed some tests to demonstrate the new check llvm-svn: 272488
Diffstat (limited to 'llvm/utils/update_test_checks.py')
-rwxr-xr-xllvm/utils/update_test_checks.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/utils/update_test_checks.py b/llvm/utils/update_test_checks.py
index 84bb641e..f87c8b3 100755
--- a/llvm/utils/update_test_checks.py
+++ b/llvm/utils/update_test_checks.py
@@ -51,6 +51,7 @@ SCRUB_X86_SHUFFLES_RE = (
flags=re.M))
SCRUB_X86_SP_RE = re.compile(r'\d+\(%(esp|rsp)\)')
SCRUB_X86_RIP_RE = re.compile(r'[.\w]+\(%rip\)')
+SCRUB_X86_LCP_RE = re.compile(r'\.LCPI[0-9]+_[0-9]+')
SCRUB_KILL_COMMENT_RE = re.compile(r'^ *#+ +kill:.*\n')
SCRUB_IR_COMMENT_RE = re.compile(r'\s*;.*')
@@ -88,6 +89,8 @@ def scrub_asm(asm):
asm = SCRUB_X86_SP_RE.sub(r'{{[0-9]+}}(%\1)', asm)
# Generically match a RIP-relative memory operand.
asm = SCRUB_X86_RIP_RE.sub(r'{{.*}}(%rip)', asm)
+ # Generically match a LCP symbol.
+ asm = SCRUB_X86_LCP_RE.sub(r'{{\.LCPI.*}}', asm)
# Strip kill operands inserted into the asm.
asm = SCRUB_KILL_COMMENT_RE.sub('', asm)
return asm