Skip to content

Commit ae6af37

Browse files
authored
update_test_checks: fix a simple regression (#111347)
Reported-by: Yingwei Zheng <[email protected]> Fixes: 02debce ("update_test_checks: improve IR value name stability (#110940)")
1 parent c98e41f commit ae6af37

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2+
; RUN: opt < %s -S | FileCheck %s
3+
4+
; Test case where the same meta variable appears twice in a line
5+
6+
define i8 @test(i8 %p) {
7+
; CHECK-LABEL: define i8 @test(
8+
; CHECK-SAME: i8 [[P:%.*]]) {
9+
; CHECK-NEXT: [[Q:%.*]] = add i8 [[P]], 1
10+
; CHECK-NEXT: [[X:%.*]] = mul i8 [[Q]], [[Q]]
11+
; CHECK-NEXT: ret i8 [[X]]
12+
;
13+
%r = sub i8 %p, 1
14+
%x = mul i8 %r, %r
15+
ret i8 %x
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2+
; RUN: opt < %s -S | FileCheck %s
3+
4+
; Test case where the same meta variable appears twice in a line
5+
6+
define i8 @test(i8 %p) {
7+
; CHECK-LABEL: define i8 @test(
8+
; CHECK-SAME: i8 [[P:%.*]]) {
9+
; CHECK-NEXT: [[Q:%.*]] = sub i8 [[P]], 1
10+
; CHECK-NEXT: [[X:%.*]] = mul i8 [[Q]], [[Q]]
11+
; CHECK-NEXT: ret i8 [[X]]
12+
;
13+
%r = sub i8 %p, 1
14+
%x = mul i8 %r, %r
15+
ret i8 %x
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# RUN: cp -f %S/Inputs/stable_ir_values6.ll %t.ll && %update_test_checks %t.ll
2+
# RUN: diff -u %t.ll %S/Inputs/stable_ir_values6.ll.expected

llvm/utils/UpdateTestChecks/common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,7 @@ def __init__(self):
16031603

16041604
if rhs_value.name in new_color.mapping:
16051605
# Same, but for a possible commit happening on the same line
1606-
if new_color.color[rhs_value.name] == lhs_value.name:
1606+
if new_color.mapping[rhs_value.name] == lhs_value.name:
16071607
continue
16081608
else:
16091609
break

0 commit comments

Comments
 (0)