[libc-commits] [libc] [libc][stdbit] implement stdc_trailing_ones (C23) (PR #80459)
Nick Desaulniers via libc-commits
libc-commits at lists.llvm.org
Fri Feb 2 15:39:05 PST 2024
================
@@ -1,112 +1,23 @@
add_custom_target(libc-stdbit-tests)
-add_libc_test(
- stdc_leading_zeros_uc_test
- SUITE
- libc-stdbit-tests
- SRCS
- stdc_leading_zeros_uc_test.cpp
- DEPENDS
- libc.src.__support.CPP.limits
- libc.src.stdbit.stdc_leading_zeros_uc
-)
-
-add_libc_test(
- stdc_leading_zeros_us_test
- SUITE
- libc-stdbit-tests
- SRCS
- stdc_leading_zeros_us_test.cpp
- DEPENDS
- libc.src.__support.CPP.limits
- libc.src.stdbit.stdc_leading_zeros_us
-)
-
-add_libc_test(
- stdc_leading_zeros_ui_test
- SUITE
- libc-stdbit-tests
- SRCS
- stdc_leading_zeros_ui_test.cpp
- DEPENDS
- libc.src.__support.CPP.limits
- libc.src.stdbit.stdc_leading_zeros_ui
-)
-
-add_libc_test(
- stdc_leading_zeros_ul_test
- SUITE
- libc-stdbit-tests
- SRCS
- stdc_leading_zeros_ul_test.cpp
- DEPENDS
- libc.src.__support.CPP.limits
- libc.src.stdbit.stdc_leading_zeros_ul
-)
-
-add_libc_test(
- stdc_leading_zeros_ull_test
- SUITE
- libc-stdbit-tests
- SRCS
- stdc_leading_zeros_ull_test.cpp
- DEPENDS
- libc.src.__support.CPP.limits
- libc.src.stdbit.stdc_leading_zeros_ull
-)
-
-add_libc_test(
- stdc_leading_ones_uc_test
- SUITE
- libc-stdbit-tests
- SRCS
- stdc_leading_ones_uc_test.cpp
- DEPENDS
- libc.src.__support.CPP.limits
- libc.src.stdbit.stdc_leading_ones_uc
-)
-
-add_libc_test(
- stdc_leading_ones_us_test
- SUITE
- libc-stdbit-tests
- SRCS
- stdc_leading_ones_us_test.cpp
- DEPENDS
- libc.src.__support.CPP.limits
- libc.src.stdbit.stdc_leading_ones_us
-)
-
-add_libc_test(
- stdc_leading_ones_ui_test
- SUITE
- libc-stdbit-tests
- SRCS
- stdc_leading_ones_ui_test.cpp
- DEPENDS
- libc.src.__support.CPP.limits
- libc.src.stdbit.stdc_leading_ones_ui
-)
-
-add_libc_test(
- stdc_leading_ones_ul_test
- SUITE
- libc-stdbit-tests
- SRCS
- stdc_leading_ones_ul_test.cpp
- DEPENDS
- libc.src.__support.CPP.limits
- libc.src.stdbit.stdc_leading_ones_ul
-)
-
-add_libc_test(
- stdc_leading_ones_ull_test
- SUITE
- libc-stdbit-tests
- SRCS
- stdc_leading_ones_ull_test.cpp
- DEPENDS
- libc.src.__support.CPP.limits
- libc.src.stdbit.stdc_leading_ones_ull
-)
-
+list(APPEND prefixes
+ leading_zeros
+ leading_ones
+ trailing_zeros
+ trailing_ones
+)
+list(APPEND suffixes c s i l ll)
+foreach(prefix IN LISTS prefixes)
+ foreach(suffix IN LISTS suffixes)
----------------
nickdesaulniers wrote:
> This should work unless we're actually depending on this appending to some list defined somewhere else.
Ah, and @lntue [pointed out](https://github.com/llvm/llvm-project/pull/80344#discussion_r1476788675) in review of the child patch that append is not necessary and to just use `set`.
https://github.com/llvm/llvm-project/pull/80459
More information about the libc-commits
mailing list