diff options
author | David Blaikie <dblaikie@gmail.com> | 2021-10-16 22:43:57 -0700 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2021-10-16 22:43:57 -0700 |
commit | 6176fda3f992b5086302b3826aa0636135cc4cc0 (patch) | |
tree | 5a6436961645c98444dbcfbd3208336b22d189b8 | |
parent | 40b9c39db15929b2b70762b68ecc6c16721f9fb1 (diff) | |
download | llvm-6176fda3f992b5086302b3826aa0636135cc4cc0.zip llvm-6176fda3f992b5086302b3826aa0636135cc4cc0.tar.gz llvm-6176fda3f992b5086302b3826aa0636135cc4cc0.tar.bz2 |
Fix a few warnings (signed/unsigned comparison in gtest, and missing field initializers)
-rw-r--r-- | compiler-rt/lib/gwp_asan/tests/alignment.cpp | 42 | ||||
-rw-r--r-- | compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp | 20 |
2 files changed, 31 insertions, 31 deletions
diff --git a/compiler-rt/lib/gwp_asan/tests/alignment.cpp b/compiler-rt/lib/gwp_asan/tests/alignment.cpp index 5f24a9a..6d1e912 100644 --- a/compiler-rt/lib/gwp_asan/tests/alignment.cpp +++ b/compiler-rt/lib/gwp_asan/tests/alignment.cpp @@ -34,81 +34,81 @@ public: // numerics of the testing. TEST(AlignmentTest, LeftAlignedAllocs) { // Alignment < Page Size. - EXPECT_EQ(0x4000, AlignmentTestGPA::alignUp( + EXPECT_EQ(0x4000u, AlignmentTestGPA::alignUp( /* Ptr */ 0x4000, /* Alignment */ 0x1)); // Alignment == Page Size. - EXPECT_EQ(0x4000, AlignmentTestGPA::alignUp( + EXPECT_EQ(0x4000u, AlignmentTestGPA::alignUp( /* Ptr */ 0x4000, /* Alignment */ 0x1000)); // Alignment > Page Size. - EXPECT_EQ(0x4000, AlignmentTestGPA::alignUp( + EXPECT_EQ(0x4000u, AlignmentTestGPA::alignUp( /* Ptr */ 0x4000, /* Alignment */ 0x4000)); } TEST(AlignmentTest, SingleByteAllocs) { // Alignment < Page Size. - EXPECT_EQ(0x1, + EXPECT_EQ(0x1u, AlignmentTestGPA::getRequiredBackingSize( /* Size */ 0x1, /* Alignment */ 0x1, /* PageSize */ 0x1000)); - EXPECT_EQ(0x7fff, AlignmentTestGPA::alignDown( + EXPECT_EQ(0x7fffu, AlignmentTestGPA::alignDown( /* Ptr */ 0x8000 - 0x1, /* Alignment */ 0x1)); // Alignment == Page Size. - EXPECT_EQ(0x1, + EXPECT_EQ(0x1u, AlignmentTestGPA::getRequiredBackingSize( /* Size */ 0x1, /* Alignment */ 0x1000, /* PageSize */ 0x1000)); - EXPECT_EQ(0x7000, AlignmentTestGPA::alignDown( + EXPECT_EQ(0x7000u, AlignmentTestGPA::alignDown( /* Ptr */ 0x8000 - 0x1, /* Alignment */ 0x1000)); // Alignment > Page Size. - EXPECT_EQ(0x3001, + EXPECT_EQ(0x3001u, AlignmentTestGPA::getRequiredBackingSize( /* Size */ 0x1, /* Alignment */ 0x4000, /* PageSize */ 0x1000)); - EXPECT_EQ(0x4000, AlignmentTestGPA::alignDown( + EXPECT_EQ(0x4000u, AlignmentTestGPA::alignDown( /* Ptr */ 0x8000 - 0x1, /* Alignment */ 0x4000)); } TEST(AlignmentTest, PageSizedAllocs) { // Alignment < Page Size. - EXPECT_EQ(0x1000, + EXPECT_EQ(0x1000u, AlignmentTestGPA::getRequiredBackingSize( /* Size */ 0x1000, /* Alignment */ 0x1, /* PageSize */ 0x1000)); - EXPECT_EQ(0x7000, AlignmentTestGPA::alignDown( + EXPECT_EQ(0x7000u, AlignmentTestGPA::alignDown( /* Ptr */ 0x8000 - 0x1000, /* Alignment */ 0x1)); // Alignment == Page Size. - EXPECT_EQ(0x1000, AlignmentTestGPA::getRequiredBackingSize( + EXPECT_EQ(0x1000u, AlignmentTestGPA::getRequiredBackingSize( /* Size */ 0x1000, /* Alignment */ 0x1000, /* PageSize */ 0x1000)); - EXPECT_EQ(0x7000, AlignmentTestGPA::alignDown( + EXPECT_EQ(0x7000u, AlignmentTestGPA::alignDown( /* Ptr */ 0x8000 - 0x1000, /* Alignment */ 0x1000)); // Alignment > Page Size. - EXPECT_EQ(0x4000, AlignmentTestGPA::getRequiredBackingSize( + EXPECT_EQ(0x4000u, AlignmentTestGPA::getRequiredBackingSize( /* Size */ 0x1000, /* Alignment */ 0x4000, /* PageSize */ 0x1000)); - EXPECT_EQ(0x4000, AlignmentTestGPA::alignDown( + EXPECT_EQ(0x4000u, AlignmentTestGPA::alignDown( /* Ptr */ 0x8000 - 0x1000, /* Alignment */ 0x4000)); } TEST(AlignmentTest, MoreThanPageAllocs) { // Alignment < Page Size. - EXPECT_EQ(0x2fff, + EXPECT_EQ(0x2fffu, AlignmentTestGPA::getRequiredBackingSize( /* Size */ 0x2fff, /* Alignment */ 0x1, /* PageSize */ 0x1000)); - EXPECT_EQ(0x5001, AlignmentTestGPA::alignDown( + EXPECT_EQ(0x5001u, AlignmentTestGPA::alignDown( /* Ptr */ 0x8000 - 0x2fff, /* Alignment */ 0x1)); // Alignment == Page Size. - EXPECT_EQ(0x2fff, AlignmentTestGPA::getRequiredBackingSize( + EXPECT_EQ(0x2fffu, AlignmentTestGPA::getRequiredBackingSize( /* Size */ 0x2fff, /* Alignment */ 0x1000, /* PageSize */ 0x1000)); - EXPECT_EQ(0x5000, AlignmentTestGPA::alignDown( + EXPECT_EQ(0x5000u, AlignmentTestGPA::alignDown( /* Ptr */ 0x8000 - 0x2fff, /* Alignment */ 0x1000)); // Alignment > Page Size. - EXPECT_EQ(0x5fff, AlignmentTestGPA::getRequiredBackingSize( + EXPECT_EQ(0x5fffu, AlignmentTestGPA::getRequiredBackingSize( /* Size */ 0x2fff, /* Alignment */ 0x4000, /* PageSize */ 0x1000)); - EXPECT_EQ(0x4000, AlignmentTestGPA::alignDown( + EXPECT_EQ(0x4000u, AlignmentTestGPA::alignDown( /* Ptr */ 0x8000 - 0x2fff, /* Alignment */ 0x4000)); } diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp index df9cada..3835ce2 100644 --- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp +++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp @@ -130,22 +130,22 @@ static struct StackDepotBenchmarkParams { bool UseCount; } params[] = { // All traces are unique, very unusual. - {10000000, 1, 1}, - {8000000, 1, 4}, - {8000000, 1, 16}, + {10000000, 1, 1, false, false}, + {8000000, 1, 4, false, false}, + {8000000, 1, 16, false, false}, // Probably most realistic sets. - {3000000, 10, 1}, - {3000000, 10, 4}, - {3000000, 10, 16}, + {3000000, 10, 1, false, false}, + {3000000, 10, 4, false, false}, + {3000000, 10, 16, false, false}, // Update use count as msan/dfsan. {3000000, 10, 1, false, true}, {3000000, 10, 4, false, true}, {3000000, 10, 16, false, true}, // Unrealistic, as above, but traces are unique inside of thread. - {4000000, 1, 4, true}, - {2000000, 1, 16, true}, - {2000000, 10, 4, true}, - {500000, 10, 16, true}, + {4000000, 1, 4, true, false}, + {2000000, 1, 16, true, false}, + {2000000, 10, 4, true, false}, + {500000, 10, 16, true, false}, {1500000, 10, 4, true, true}, {800000, 10, 16, true, true}, }; |