[PATCH] D65563: [LLVM][Alignment] Fix AlignmentTest on platform where size_t != uint64_t
Guillaume Chatelet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 1 02:21:23 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rG41dfc69dc7fc: [LLVM][Alignment] Fix AlignmentTest on platform where size_t != uint64_t (authored by gchatelet).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65563/new/
https://reviews.llvm.org/D65563
Files:
llvm/unittests/Support/AlignmentTest.cpp
Index: llvm/unittests/Support/AlignmentTest.cpp
===================================================================
--- llvm/unittests/Support/AlignmentTest.cpp
+++ llvm/unittests/Support/AlignmentTest.cpp
@@ -29,7 +29,7 @@
}
TEST(AlignmentTest, ValidCTors) {
- for (size_t Value : getValidAlignments()) {
+ for (uint64_t Value : getValidAlignments()) {
EXPECT_EQ(Align(Value).value(), Value);
EXPECT_EQ((*MaybeAlign(Value)).value(), Value);
}
@@ -45,7 +45,7 @@
}
TEST(AlignmentTest, Division) {
- for (size_t Value : getValidAlignments()) {
+ for (uint64_t Value : getValidAlignments()) {
if (Value > 1) {
EXPECT_EQ(Align(Value) / 2, Value / 2);
EXPECT_EQ(MaybeAlign(Value) / 2, Value / 2);
@@ -89,7 +89,7 @@
}
TEST(AlignmentTest, Log2) {
- for (size_t Value : getValidAlignments()) {
+ for (uint64_t Value : getValidAlignments()) {
EXPECT_EQ(Log2(Align(Value)), Log2_64(Value));
EXPECT_EQ(Log2(MaybeAlign(Value)), Log2_64(Value));
}
@@ -122,7 +122,7 @@
}
TEST(AlignmentTest, Encode_Decode) {
- for (size_t Value : getValidAlignments()) {
+ for (uint64_t Value : getValidAlignments()) {
{
Align Actual(Value);
Align Expected = decodeMaybeAlign(encode(Actual)).getValue();
@@ -249,14 +249,14 @@
TEST(AlignmentDeathTest, InvalidCTors) {
EXPECT_DEATH((Align(0)), "Value must not be 0");
- for (size_t Value : getNonPowerOfTwo()) {
+ for (uint64_t Value : getNonPowerOfTwo()) {
EXPECT_DEATH((Align(Value)), "Alignment is not a power of 2");
EXPECT_DEATH((MaybeAlign(Value)), "Alignment is not 0 or a power of 2");
}
}
TEST(AlignmentDeathTest, ComparisonsWithZero) {
- for (size_t Value : getValidAlignmentsForDeathTest()) {
+ for (uint64_t Value : getValidAlignmentsForDeathTest()) {
EXPECT_DEATH((void)(Align(Value) == 0), ".* should be defined");
EXPECT_DEATH((void)(Align(Value) != 0), ".* should be defined");
EXPECT_DEATH((void)(Align(Value) >= 0), ".* should be defined");
@@ -267,7 +267,7 @@
}
TEST(AlignmentDeathTest, CompareMaybeAlignToZero) {
- for (size_t Value : getValidAlignmentsForDeathTest()) {
+ for (uint64_t Value : getValidAlignmentsForDeathTest()) {
// MaybeAlign is allowed to be == or != 0
(void)(MaybeAlign(Value) == 0);
(void)(MaybeAlign(Value) != 0);
@@ -279,7 +279,7 @@
}
TEST(AlignmentDeathTest, CompareAlignToUndefMaybeAlign) {
- for (size_t Value : getValidAlignmentsForDeathTest()) {
+ for (uint64_t Value : getValidAlignmentsForDeathTest()) {
EXPECT_DEATH((void)(Align(Value) == MaybeAlign(0)), ".* should be defined");
EXPECT_DEATH((void)(Align(Value) != MaybeAlign(0)), ".* should be defined");
EXPECT_DEATH((void)(Align(Value) >= MaybeAlign(0)), ".* should be defined");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65563.212759.patch
Type: text/x-patch
Size: 2775 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190801/42d50a19/attachment.bin>
More information about the llvm-commits
mailing list