[libc-commits] [libc] [libc] Expand usage of libc null checks. (PR #116262)

Aly ElAshram via libc-commits libc-commits at lists.llvm.org
Fri Feb 7 16:20:16 PST 2025


================
@@ -374,7 +383,7 @@ add_libc_test(
     libc.src.string.memset_explicit
 )
 
-add_libc_multi_impl_test(memcmp libc-string-tests SRCS memcmp_test.cpp)
+add_libc_multi_impl_test(memcmp UNIT_TEST_ONLY libc-string-tests SRCS memcmp_test.cpp)
----------------
AlyElashram wrote:

I agree with you on this comment. I just have one question regarding this. In all the tests the signal sent on a full build is different than the one sent in the "normal" tests. i.e it fails with `SIGILL` and then it fails with other signals when fully building. 

when I tried the `EXPECT_DEATH` macro without a signal it caused a compilation error ,because it can't match a macro when no signal is supplied.

 Any explanation as to why it won't compile when added in a `TEST` but will compile when in a `TEST_F` ? Maybe I'm misunderstanding why it compiles in the `nanf_test.cpp` file here, so please correct me.
 
 Also here's the macro in question [EXPECT_DEATH](https://github.com/llvm/llvm-project/blob/e6e8ac59ba45e03da92aebec1f4561c1fa970df1/libc/test/UnitTest/LibcTest.h#L484C1-L485C53).

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


More information about the libc-commits mailing list