[PATCH] D72632: [unittests] Fix "comparison of integers of different signs" warnings

Miloš Stojanović via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 04:30:11 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGbff33bd5c83b: [unittests] Fix "comparison of integers of different signs" warnings (authored by mstojanovic).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72632/new/

https://reviews.llvm.org/D72632

Files:
  llvm/unittests/ExecutionEngine/JITLink/LinkGraphTests.cpp
  llvm/unittests/Object/MinidumpTest.cpp


Index: llvm/unittests/Object/MinidumpTest.cpp
===================================================================
--- llvm/unittests/Object/MinidumpTest.cpp
+++ llvm/unittests/Object/MinidumpTest.cpp
@@ -589,7 +589,7 @@
     const MinidumpFile &File = **ExpectedFile;
     auto ExpectedInfo = File.getMemoryInfoList();
     ASSERT_THAT_EXPECTED(ExpectedInfo, Succeeded());
-    ASSERT_EQ(1u, std::distance(ExpectedInfo->begin(), ExpectedInfo->end()));
+    ASSERT_EQ(1, std::distance(ExpectedInfo->begin(), ExpectedInfo->end()));
     const MemoryInfo &Info = *ExpectedInfo.get().begin();
     EXPECT_EQ(0x0706050403020100u, Info.BaseAddress);
     EXPECT_EQ(0x0504030201000908u, Info.AllocationBase);
Index: llvm/unittests/ExecutionEngine/JITLink/LinkGraphTests.cpp
===================================================================
--- llvm/unittests/ExecutionEngine/JITLink/LinkGraphTests.cpp
+++ llvm/unittests/ExecutionEngine/JITLink/LinkGraphTests.cpp
@@ -56,17 +56,17 @@
                                 false, false);
 
   // Check that iteration of blocks within a section behaves as expected.
-  EXPECT_EQ(std::distance(Sec1.blocks().begin(), Sec1.blocks().end()), 2U);
+  EXPECT_EQ(std::distance(Sec1.blocks().begin(), Sec1.blocks().end()), 2);
   EXPECT_TRUE(llvm::count(Sec1.blocks(), &B1));
   EXPECT_TRUE(llvm::count(Sec1.blocks(), &B2));
 
   // Check that iteration of symbols within a section behaves as expected.
-  EXPECT_EQ(std::distance(Sec1.symbols().begin(), Sec1.symbols().end()), 2U);
+  EXPECT_EQ(std::distance(Sec1.symbols().begin(), Sec1.symbols().end()), 2);
   EXPECT_TRUE(llvm::count(Sec1.symbols(), &S1));
   EXPECT_TRUE(llvm::count(Sec1.symbols(), &S2));
 
   // Check that iteration of blocks across sections behaves as expected.
-  EXPECT_EQ(std::distance(G.blocks().begin(), G.blocks().end()), 4U);
+  EXPECT_EQ(std::distance(G.blocks().begin(), G.blocks().end()), 4);
   EXPECT_TRUE(llvm::count(G.blocks(), &B1));
   EXPECT_TRUE(llvm::count(G.blocks(), &B2));
   EXPECT_TRUE(llvm::count(G.blocks(), &B3));
@@ -75,8 +75,7 @@
   // Check that iteration of defined symbols across sections behaves as
   // expected.
   EXPECT_EQ(
-      std::distance(G.defined_symbols().begin(), G.defined_symbols().end()),
-      4U);
+      std::distance(G.defined_symbols().begin(), G.defined_symbols().end()), 4);
   EXPECT_TRUE(llvm::count(G.defined_symbols(), &S1));
   EXPECT_TRUE(llvm::count(G.defined_symbols(), &S2));
   EXPECT_TRUE(llvm::count(G.defined_symbols(), &S3));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72632.237936.patch
Type: text/x-patch
Size: 2503 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200114/66d27408/attachment.bin>


More information about the llvm-commits mailing list