[libc-commits] [libc] [libc][test] update constants used in stdbit test (PR #83893)
Nick Desaulniers via libc-commits
libc-commits at lists.llvm.org
Mon Mar 4 10:55:39 PST 2024
https://github.com/nickdesaulniers created https://github.com/llvm/llvm-project/pull/83893
Either:
- I forgot my alphabet (that E comes before F).
- My juvenile inner brain finds unsigned literal constants with the sequence
FU funny.
¿Por qué no los dos?
>From 38b822f55aea2a5b29a87b611be5fbdb536cba0b Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Mon, 4 Mar 2024 10:53:32 -0800
Subject: [PATCH] [libc][test] update constants used in stdbit test
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Either:
- I forgot my alphabet (that E comes before F).
- My juvenile inner brain finds unsigned literal constants with the sequence
FU funny.
¿Por qué no los dos?
---
libc/test/include/stdbit_test.cpp | 38 +++++++++++++++----------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/libc/test/include/stdbit_test.cpp b/libc/test/include/stdbit_test.cpp
index acb79ca0f3ff11..4c792409bbc7b1 100644
--- a/libc/test/include/stdbit_test.cpp
+++ b/libc/test/include/stdbit_test.cpp
@@ -27,60 +27,60 @@ unsigned stdc_leading_zeros_uc(unsigned char) noexcept { return 0xAAU; }
unsigned stdc_leading_zeros_us(unsigned short) noexcept { return 0xABU; }
unsigned stdc_leading_zeros_ui(unsigned) noexcept { return 0xACU; }
unsigned stdc_leading_zeros_ul(unsigned long) noexcept { return 0xADU; }
-unsigned stdc_leading_zeros_ull(unsigned long long) noexcept { return 0xAFU; }
+unsigned stdc_leading_zeros_ull(unsigned long long) noexcept { return 0xAEU; }
unsigned stdc_leading_ones_uc(unsigned char) noexcept { return 0xBAU; }
unsigned stdc_leading_ones_us(unsigned short) noexcept { return 0xBBU; }
unsigned stdc_leading_ones_ui(unsigned) noexcept { return 0xBCU; }
unsigned stdc_leading_ones_ul(unsigned long) noexcept { return 0xBDU; }
-unsigned stdc_leading_ones_ull(unsigned long long) noexcept { return 0xBFU; }
+unsigned stdc_leading_ones_ull(unsigned long long) noexcept { return 0xBEU; }
unsigned stdc_trailing_zeros_uc(unsigned char) noexcept { return 0xCAU; }
unsigned stdc_trailing_zeros_us(unsigned short) noexcept { return 0xCBU; }
unsigned stdc_trailing_zeros_ui(unsigned) noexcept { return 0xCCU; }
unsigned stdc_trailing_zeros_ul(unsigned long) noexcept { return 0xCDU; }
-unsigned stdc_trailing_zeros_ull(unsigned long long) noexcept { return 0xCFU; }
+unsigned stdc_trailing_zeros_ull(unsigned long long) noexcept { return 0xCEU; }
unsigned stdc_trailing_ones_uc(unsigned char) noexcept { return 0xDAU; }
unsigned stdc_trailing_ones_us(unsigned short) noexcept { return 0xDBU; }
unsigned stdc_trailing_ones_ui(unsigned) noexcept { return 0xDCU; }
unsigned stdc_trailing_ones_ul(unsigned long) noexcept { return 0xDDU; }
-unsigned stdc_trailing_ones_ull(unsigned long long) noexcept { return 0xDFU; }
+unsigned stdc_trailing_ones_ull(unsigned long long) noexcept { return 0xDEU; }
unsigned stdc_first_leading_zero_uc(unsigned char) noexcept { return 0xEAU; }
unsigned stdc_first_leading_zero_us(unsigned short) noexcept { return 0xEBU; }
unsigned stdc_first_leading_zero_ui(unsigned) noexcept { return 0xECU; }
unsigned stdc_first_leading_zero_ul(unsigned long) noexcept { return 0xEDU; }
unsigned stdc_first_leading_zero_ull(unsigned long long) noexcept {
- return 0xEFU;
+ return 0xEEU;
}
unsigned stdc_first_leading_one_uc(unsigned char) noexcept { return 0xFAU; }
unsigned stdc_first_leading_one_us(unsigned short) noexcept { return 0xFBU; }
unsigned stdc_first_leading_one_ui(unsigned) noexcept { return 0xFCU; }
unsigned stdc_first_leading_one_ul(unsigned long) noexcept { return 0xFDU; }
unsigned stdc_first_leading_one_ull(unsigned long long) noexcept {
- return 0xFFU;
+ return 0xFEU;
}
unsigned stdc_first_trailing_zero_uc(unsigned char) noexcept { return 0x0AU; }
unsigned stdc_first_trailing_zero_us(unsigned short) noexcept { return 0x0BU; }
unsigned stdc_first_trailing_zero_ui(unsigned) noexcept { return 0x0CU; }
unsigned stdc_first_trailing_zero_ul(unsigned long) noexcept { return 0x0DU; }
unsigned stdc_first_trailing_zero_ull(unsigned long long) noexcept {
- return 0x0FU;
+ return 0x0EU;
}
unsigned stdc_first_trailing_one_uc(unsigned char) noexcept { return 0x1AU; }
unsigned stdc_first_trailing_one_us(unsigned short) noexcept { return 0x1BU; }
unsigned stdc_first_trailing_one_ui(unsigned) noexcept { return 0x1CU; }
unsigned stdc_first_trailing_one_ul(unsigned long) noexcept { return 0x1DU; }
unsigned stdc_first_trailing_one_ull(unsigned long long) noexcept {
- return 0x1FU;
+ return 0x1EU;
}
unsigned stdc_count_zeros_uc(unsigned char) noexcept { return 0x2AU; }
unsigned stdc_count_zeros_us(unsigned short) noexcept { return 0x2BU; }
unsigned stdc_count_zeros_ui(unsigned) noexcept { return 0x2CU; }
unsigned stdc_count_zeros_ul(unsigned long) noexcept { return 0x2DU; }
-unsigned stdc_count_zeros_ull(unsigned long long) noexcept { return 0x2FU; }
+unsigned stdc_count_zeros_ull(unsigned long long) noexcept { return 0x2EU; }
unsigned stdc_count_ones_uc(unsigned char) noexcept { return 0x3AU; }
unsigned stdc_count_ones_us(unsigned short) noexcept { return 0x3BU; }
unsigned stdc_count_ones_ui(unsigned) noexcept { return 0x3CU; }
unsigned stdc_count_ones_ul(unsigned long) noexcept { return 0x3DU; }
-unsigned stdc_count_ones_ull(unsigned long long) noexcept { return 0x3FU; }
+unsigned stdc_count_ones_ull(unsigned long long) noexcept { return 0x3EU; }
bool stdc_has_single_bit_uc(unsigned char) noexcept { return false; }
bool stdc_has_single_bit_us(unsigned short) noexcept { return false; }
bool stdc_has_single_bit_ui(unsigned) noexcept { return false; }
@@ -95,7 +95,7 @@ TEST(LlvmLibcStdbitTest, TypeGenericMacroLeadingZeros) {
EXPECT_EQ(stdc_leading_zeros(static_cast<unsigned short>(0U)), 0xABU);
EXPECT_EQ(stdc_leading_zeros(0U), 0xACU);
EXPECT_EQ(stdc_leading_zeros(0UL), 0xADU);
- EXPECT_EQ(stdc_leading_zeros(0ULL), 0xAFU);
+ EXPECT_EQ(stdc_leading_zeros(0ULL), 0xAEU);
}
TEST(LlvmLibcStdbitTest, TypeGenericMacroLeadingOnes) {
@@ -103,7 +103,7 @@ TEST(LlvmLibcStdbitTest, TypeGenericMacroLeadingOnes) {
EXPECT_EQ(stdc_leading_ones(static_cast<unsigned short>(0U)), 0xBBU);
EXPECT_EQ(stdc_leading_ones(0U), 0xBCU);
EXPECT_EQ(stdc_leading_ones(0UL), 0xBDU);
- EXPECT_EQ(stdc_leading_ones(0ULL), 0xBFU);
+ EXPECT_EQ(stdc_leading_ones(0ULL), 0xBEU);
}
TEST(LlvmLibcStdbitTest, TypeGenericMacroTrailingZeros) {
@@ -111,7 +111,7 @@ TEST(LlvmLibcStdbitTest, TypeGenericMacroTrailingZeros) {
EXPECT_EQ(stdc_trailing_zeros(static_cast<unsigned short>(0U)), 0xCBU);
EXPECT_EQ(stdc_trailing_zeros(0U), 0xCCU);
EXPECT_EQ(stdc_trailing_zeros(0UL), 0xCDU);
- EXPECT_EQ(stdc_trailing_zeros(0ULL), 0xCFU);
+ EXPECT_EQ(stdc_trailing_zeros(0ULL), 0xCEU);
}
TEST(LlvmLibcStdbitTest, TypeGenericMacroTrailingOnes) {
@@ -127,7 +127,7 @@ TEST(LlvmLibcStdbitTest, TypeGenericMacroFirstLeadingZero) {
EXPECT_EQ(stdc_first_leading_zero(static_cast<unsigned short>(0U)), 0xEBU);
EXPECT_EQ(stdc_first_leading_zero(0U), 0xECU);
EXPECT_EQ(stdc_first_leading_zero(0UL), 0xEDU);
- EXPECT_EQ(stdc_first_leading_zero(0ULL), 0xEFU);
+ EXPECT_EQ(stdc_first_leading_zero(0ULL), 0xEEU);
}
TEST(LlvmLibcStdbitTest, TypeGenericMacroFirstLeadingOne) {
@@ -135,7 +135,7 @@ TEST(LlvmLibcStdbitTest, TypeGenericMacroFirstLeadingOne) {
EXPECT_EQ(stdc_first_leading_one(static_cast<unsigned short>(0U)), 0xFBU);
EXPECT_EQ(stdc_first_leading_one(0U), 0xFCU);
EXPECT_EQ(stdc_first_leading_one(0UL), 0xFDU);
- EXPECT_EQ(stdc_first_leading_one(0ULL), 0xFFU);
+ EXPECT_EQ(stdc_first_leading_one(0ULL), 0xFEU);
}
TEST(LlvmLibcStdbitTest, TypeGenericMacroFirstTrailingZero) {
@@ -143,7 +143,7 @@ TEST(LlvmLibcStdbitTest, TypeGenericMacroFirstTrailingZero) {
EXPECT_EQ(stdc_first_trailing_zero(static_cast<unsigned short>(0U)), 0x0BU);
EXPECT_EQ(stdc_first_trailing_zero(0U), 0x0CU);
EXPECT_EQ(stdc_first_trailing_zero(0UL), 0x0DU);
- EXPECT_EQ(stdc_first_trailing_zero(0ULL), 0x0FU);
+ EXPECT_EQ(stdc_first_trailing_zero(0ULL), 0x0EU);
}
TEST(LlvmLibcStdbitTest, TypeGenericMacroFirstTrailingOne) {
@@ -151,7 +151,7 @@ TEST(LlvmLibcStdbitTest, TypeGenericMacroFirstTrailingOne) {
EXPECT_EQ(stdc_first_trailing_one(static_cast<unsigned short>(0U)), 0x1BU);
EXPECT_EQ(stdc_first_trailing_one(0U), 0x1CU);
EXPECT_EQ(stdc_first_trailing_one(0UL), 0x1DU);
- EXPECT_EQ(stdc_first_trailing_one(0ULL), 0x1FU);
+ EXPECT_EQ(stdc_first_trailing_one(0ULL), 0x1EU);
}
TEST(LlvmLibcStdbitTest, TypeGenericMacroCountZeros) {
@@ -159,7 +159,7 @@ TEST(LlvmLibcStdbitTest, TypeGenericMacroCountZeros) {
EXPECT_EQ(stdc_count_zeros(static_cast<unsigned short>(0U)), 0x2BU);
EXPECT_EQ(stdc_count_zeros(0U), 0x2CU);
EXPECT_EQ(stdc_count_zeros(0UL), 0x2DU);
- EXPECT_EQ(stdc_count_zeros(0ULL), 0x2FU);
+ EXPECT_EQ(stdc_count_zeros(0ULL), 0x2EU);
}
TEST(LlvmLibcStdbitTest, TypeGenericMacroCountOnes) {
@@ -167,7 +167,7 @@ TEST(LlvmLibcStdbitTest, TypeGenericMacroCountOnes) {
EXPECT_EQ(stdc_count_ones(static_cast<unsigned short>(0U)), 0x3BU);
EXPECT_EQ(stdc_count_ones(0U), 0x3CU);
EXPECT_EQ(stdc_count_ones(0UL), 0x3DU);
- EXPECT_EQ(stdc_count_ones(0ULL), 0x3FU);
+ EXPECT_EQ(stdc_count_ones(0ULL), 0x3EU);
}
TEST(LlvmLibcStdbitTest, TypeGenericMacroHasSingleBit) {
More information about the libc-commits
mailing list