1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

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.

llvm-svn: 317509
This commit is contained in:
Justin Bogner 2017-11-06 21:06:09 +00:00
parent 55891e6a9c
commit fa9825879a

View File

@ -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)