[libc-commits] [PATCH] D119242: [libc] undefined reference in LibcTest.cpp

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Feb 9 09:48:57 PST 2022

sivachandra accepted this revision.
sivachandra added inline comments.
This revision is now accepted and ready to land.

Comment at: libc/utils/UnitTest/LibcTest.cpp:200
+template bool test<char>(RunContext *Ctx, TestCondition Cond, char LHS,
+                         char RHS, const char *LHSStr, const char *RHSStr,
I think what is happening is this: We were instantiating the member functions which call these non-member internal functions. So, the member function instantiation triggered the instantiation of these non-member functions. My guess is that, your GCC is probably not going through the call graph and instantiating the internal functions. Hence you are running into the undefined reference problem. That said though, instantiating these internal functions is more appropriate. So, your change LGTM.

  rG LLVM Github Monorepo



More information about the libc-commits mailing list