[libc-commits] [libc] [libc][stdbit] implement stdc_count_ones (C23) (PR #82444)

via libc-commits libc-commits at lists.llvm.org
Tue Feb 20 16:31:48 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 563ef306017a47d387f1c36dd562b172c1ad0626 4314e6d9a5d82b58f002fef9dc07d183e3e63e91 -- libc/src/stdbit/stdc_count_ones_uc.cpp libc/src/stdbit/stdc_count_ones_uc.h libc/src/stdbit/stdc_count_ones_ui.cpp libc/src/stdbit/stdc_count_ones_ui.h libc/src/stdbit/stdc_count_ones_ul.cpp libc/src/stdbit/stdc_count_ones_ul.h libc/src/stdbit/stdc_count_ones_ull.cpp libc/src/stdbit/stdc_count_ones_ull.h libc/src/stdbit/stdc_count_ones_us.cpp libc/src/stdbit/stdc_count_ones_us.h libc/src/stdbit/stdc_count_zeros_uc.cpp libc/src/stdbit/stdc_count_zeros_uc.h libc/src/stdbit/stdc_count_zeros_ui.cpp libc/src/stdbit/stdc_count_zeros_ui.h libc/src/stdbit/stdc_count_zeros_ul.cpp libc/src/stdbit/stdc_count_zeros_ul.h libc/src/stdbit/stdc_count_zeros_ull.cpp libc/src/stdbit/stdc_count_zeros_ull.h libc/src/stdbit/stdc_count_zeros_us.cpp libc/src/stdbit/stdc_count_zeros_us.h libc/test/src/stdbit/stdc_count_ones_uc_test.cpp libc/test/src/stdbit/stdc_count_ones_ui_test.cpp libc/test/src/stdbit/stdc_count_ones_ul_test.cpp libc/test/src/stdbit/stdc_count_ones_ull_test.cpp libc/test/src/stdbit/stdc_count_ones_us_test.cpp libc/test/src/stdbit/stdc_count_zeros_uc_test.cpp libc/test/src/stdbit/stdc_count_zeros_ui_test.cpp libc/test/src/stdbit/stdc_count_zeros_ul_test.cpp libc/test/src/stdbit/stdc_count_zeros_ull_test.cpp libc/test/src/stdbit/stdc_count_zeros_us_test.cpp libc/include/llvm-libc-macros/stdbit-macros.h libc/test/include/stdbit_test.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/test/src/stdbit/stdc_count_ones_ui_test.cpp b/libc/test/src/stdbit/stdc_count_ones_ui_test.cpp
index c61dada064..198e366584 100644
--- a/libc/test/src/stdbit/stdc_count_ones_ui_test.cpp
+++ b/libc/test/src/stdbit/stdc_count_ones_ui_test.cpp
@@ -16,5 +16,6 @@ TEST(LlvmLibcStdcCountOnesUiTest, Zero) {
 
 TEST(LlvmLibcStdcCountOnesUiTest, Ones) {
   for (unsigned i = 0U; i != UINT_WIDTH; ++i)
-    EXPECT_EQ(LIBC_NAMESPACE::stdc_count_ones_ui(UINT_MAX >> i), UINT_WIDTH - i);
+    EXPECT_EQ(LIBC_NAMESPACE::stdc_count_ones_ui(UINT_MAX >> i),
+              UINT_WIDTH - i);
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/82444


More information about the libc-commits mailing list