summaryrefslogtreecommitdiffstats
path: root/llvm/utils/update_llc_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_llc_test_checks.py
parent897711f018e9060186cc526b46fcb26ef6dca419 (diff)
downloadbcm5719-llvm-2b7c02a04f465c298d008ebf8b7cc616e3d3db89.tar.gz
bcm5719-llvm-2b7c02a04f465c298d008ebf8b7cc616e3d3db89.zip
[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_llc_test_checks.py')
-rwxr-xr-xllvm/utils/update_llc_test_checks.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/utils/update_llc_test_checks.py b/llvm/utils/update_llc_test_checks.py
index 8669b32324a..ea3ac79a3a1 100755
--- a/llvm/utils/update_llc_test_checks.py
+++ b/llvm/utils/update_llc_test_checks.py
@@ -36,6 +36,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')
RUN_LINE_RE = re.compile('^\s*;\s*RUN:\s*(.*)$')
@@ -61,6 +62,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)
# Strip trailing whitespace.
@@ -144,7 +147,7 @@ def main():
args = parser.parse_args()
autogenerated_note = ('; NOTE: Assertions have been autogenerated by '
- + os.path.basename(__file__))
+ 'utils/' + os.path.basename(__file__))
for test in args.tests:
if args.verbose:
OpenPOWER on IntegriCloud