summaryrefslogtreecommitdiff
path: root/utils/update_mir_test_checks.py
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2017-11-06 21:06:09 +0000
committerJustin Bogner <mail@justinbogner.com>2017-11-06 21:06:09 +0000
commit82cd943eb1deceb561fb8e7c9ad7c796c883b2d3 (patch)
tree3be51f67e2513291484ae7aff236c68399b92ead /utils/update_mir_test_checks.py
parente005ea7d87872c2322e011ae7b4b02954052a934 (diff)
update_mir_test_checks: Be careful about replacing entire vregs
Previously, this could end up replacing a vreg like %14 with [[VREG1]]4, where VREG1 was the match for %1. That's obviously not correct, though it hasn't actually come up in any tests I've converted so far. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317509 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/update_mir_test_checks.py')
-rwxr-xr-xutils/update_mir_test_checks.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/update_mir_test_checks.py b/utils/update_mir_test_checks.py
index 015c4279bad..2934f09f6b3 100755
--- a/utils/update_mir_test_checks.py
+++ b/utils/update_mir_test_checks.py
@@ -254,7 +254,8 @@ def add_check_lines(test, output_lines, prefix, func_name, single_bb,
func_line = func_line.replace(
vreg.group(1), '[[{}:%[0-9]+]]'.format(name), 1)
for number, name in vreg_map.items():
- func_line = func_line.replace(number, '[[{}]]'.format(name))
+ func_line = re.sub(r'{}\b'.format(number), '[[{}]]'.format(name),
+ func_line)
check_line = '{}: {}'.format(check, func_line[indent:]).rstrip()
output_lines.append(check_line)