Skip to content

Commit 0ae342f

Browse files
committed
[lldb][test] Fix -Wsign-compare in RegisterFlagsTest.cpp (NFC)
/data/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:1526:11: error: comparison of integers of different signs: 'const unsigned long long' and 'const int' [-Werror,-Wsign-compare] if (lhs == rhs) { ~~~ ^ ~~~ /data/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:1553:12: note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long long, int>' requested here return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs); ^ /data/llvm-project/lldb/unittests/Target/RegisterFlagsTest.cpp:128:3: note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long long, int, nullptr>' requested here ASSERT_EQ(0x12345678ULL, rf.ReverseFieldOrder(0x12345678)); ^ /data/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:2056:32: note: expanded from macro 'ASSERT_EQ' ^ /data/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:2040:54: note: expanded from macro 'GTEST_ASSERT_EQ' ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2) ^ 1 error generated.
1 parent 4add0e3 commit 0ae342f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lldb/unittests/Target/RegisterFlagsTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ TEST(RegisterFlagsTest, RegisterFlagsPadding) {
125125
TEST(RegisterFieldsTest, ReverseFieldOrder) {
126126
// Unchanged
127127
RegisterFlags rf("", 4, {make_field(0, 31)});
128-
ASSERT_EQ(0x12345678ULL, rf.ReverseFieldOrder(0x12345678));
128+
ASSERT_EQ(0x12345678ULL, (unsigned long long)rf.ReverseFieldOrder(0x12345678));
129129

130130
// Swap the two halves around.
131131
RegisterFlags rf2("", 4, {make_field(16, 31), make_field(0, 15)});
132-
ASSERT_EQ(0x56781234ULL, rf2.ReverseFieldOrder(0x12345678));
132+
ASSERT_EQ(0x56781234ULL, (unsigned long long)rf2.ReverseFieldOrder(0x12345678));
133133

134134
// Many small fields.
135135
RegisterFlags rf3("", 4,

0 commit comments

Comments
 (0)