[libc-commits] [libc] [libc] implement stdc_leading_zeros_u* for stdbit.h (PR #79669)

via libc-commits libc-commits at lists.llvm.org
Fri Jan 26 16:16:19 PST 2024


================
@@ -0,0 +1,22 @@
+//===-- Unittests for stdbit ----------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDSList-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "test/UnitTest/Test.h"
+
+#include "llvm-libc-macros/stdbit-macros.h"
+#include "src/__support/CPP/limits.h" // UINT_WIDTH
+#include "src/stdbit/stdc_leading_zeros_uc.h"
+#include "src/stdbit/stdc_leading_zeros_ui.h"
+#include "src/stdbit/stdc_leading_zeros_ul.h"
+#include "src/stdbit/stdc_leading_zeros_ull.h"
+#include "src/stdbit/stdc_leading_zeros_us.h"
+
+TEST(LlvmLibcStdbitTest, TypeGenericMacro) {
+  using namespace LIBC_NAMESPACE;
----------------
michaelrj-google wrote:

generally in tests we should avoid doing `using namespace LIBC_NAMESPACE` since it means that if the namespaced symbol isn't available but the system one is, the test will still pass.

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


More information about the libc-commits mailing list