[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:20 PST 2024


================
@@ -0,0 +1,22 @@
+//===-- Unittests for stdc_leading_zeros_uc -------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/__support/CPP/limits.h"
+#include "src/stdbit/stdc_leading_zeros_uc.h"
+#include "test/UnitTest/Test.h"
+
+#define LZ(x) LIBC_NAMESPACE::stdc_leading_zeros_uc((x))
----------------
michaelrj-google wrote:

given that this macro is used in two places, I think it's cleaner to not use the macro and instead write out the function call. Same for the other test files.

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


More information about the libc-commits mailing list