summaryrefslogtreecommitdiff
path: root/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
commit58140e4f696ab79f16f0c36968f0bc7f496a9d0e (patch)
tree89bc60637a3185e1271a7fdc0a081a13bc2ba44f /utils/update_llc_test_checks.py
parent07ef6bb26b3b6efe7d864ad7656042cfb9abb07c (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272488 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/update_llc_test_checks.py')
-rwxr-xr-xutils/update_llc_test_checks.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/update_llc_test_checks.py b/utils/update_llc_test_checks.py
index 8669b32324a..ea3ac79a3a1 100755
--- a/utils/update_llc_test_checks.py
+++ b/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: