[PATCH] D33789: Export the required symbol from DynamicLibraryTests

Frederich Munch via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 10:11:29 PDT 2017


marsupial added inline comments.


================
Comment at: unittests/Support/DynamicLibrary/DynamicLibraryLib.cxx:1-12
+//===- llvm/unittest/Support/DynamicLibrary/DynamicLibraryLib.cpp ---------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
----------------
marsupial wrote:
> Perhaps a more general filename (**TestA.cpp**) and use macros to determine the return value so this implementation can be used in other modules.  This would allow for more testing/coverage in the future of other aspects of the DynamicLibrary manager (i.e. symbol resolution across multiple libs).
> 
> ```
> extern "C" PIPSQUEAK_EXPORT const char *TestA() {
> #ifndef PIPSQUEAK_TESTA_RETURN
>   return "ProcessCall";
> #else
>   return PIPSQUEAK_TESTA_RETURN;
> #endif
> }
> ```
> 
> **PipSqueak.cxx**
> ```
> #define PIPSQUEAK_TESTA_RETURN "LibCall"
> #include "TestA.cpp"
> ```
Actually **ExportedSyms.cpp** is probably a bit than **TestA.cpp** for when other functions/symbols are added.


https://reviews.llvm.org/D33789





More information about the llvm-commits mailing list