[libc-commits] [libc] [libc] wmemcmp nullptr handling (PR #142058)

via libc-commits libc-commits at lists.llvm.org
Fri May 30 11:18:59 PDT 2025


================
@@ -66,3 +66,11 @@ TEST(LlvmLibcWMemcmpTest, LhsRhsAreTheSameLong) {
   const wchar_t *rhs = L"aaaaaaaaaaaaaa";
   EXPECT_EQ(LIBC_NAMESPACE::wmemcmp(lhs, rhs, 15), 0);
 }
+
+TEST(LlvmLibcWMemcmpTest, NullptrCrash) {
----------------
lntue wrote:

Put the test inside `#if ...` similar to https://github.com/llvm/llvm-project/blob/main/libc/test/src/math/smoke/nanf_test.cpp#L46

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


More information about the libc-commits mailing list