Skip to content

update_test_checks: fix a simple regression #111347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -S | FileCheck %s

; Test case where the same meta variable appears twice in a line

define i8 @test(i8 %p) {
; CHECK-LABEL: define i8 @test(
; CHECK-SAME: i8 [[P:%.*]]) {
; CHECK-NEXT: [[Q:%.*]] = add i8 [[P]], 1
; CHECK-NEXT: [[X:%.*]] = mul i8 [[Q]], [[Q]]
; CHECK-NEXT: ret i8 [[X]]
;
%r = sub i8 %p, 1
%x = mul i8 %r, %r
ret i8 %x
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -S | FileCheck %s

; Test case where the same meta variable appears twice in a line

define i8 @test(i8 %p) {
; CHECK-LABEL: define i8 @test(
; CHECK-SAME: i8 [[P:%.*]]) {
; CHECK-NEXT: [[Q:%.*]] = sub i8 [[P]], 1
; CHECK-NEXT: [[X:%.*]] = mul i8 [[Q]], [[Q]]
; CHECK-NEXT: ret i8 [[X]]
;
%r = sub i8 %p, 1
%x = mul i8 %r, %r
ret i8 %x
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# RUN: cp -f %S/Inputs/stable_ir_values6.ll %t.ll && %update_test_checks %t.ll
# RUN: diff -u %t.ll %S/Inputs/stable_ir_values6.ll.expected
2 changes: 1 addition & 1 deletion llvm/utils/UpdateTestChecks/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,7 @@ def __init__(self):

if rhs_value.name in new_color.mapping:
# Same, but for a possible commit happening on the same line
if new_color.color[rhs_value.name] == lhs_value.name:
if new_color.mapping[rhs_value.name] == lhs_value.name:
continue
else:
break
Expand Down
Loading