[PATCH] D33789: Export the required symbol from DynamicLibraryTests
Roger Ferrer Ibanez via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 12 00:22:47 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL305181: Export the required symbol from DynamicLibraryTests (authored by rogfer01).
Changed prior to commit:
https://reviews.llvm.org/D33789?vs=101548&id=102156#toc
Repository:
rL LLVM
https://reviews.llvm.org/D33789
Files:
llvm/trunk/unittests/Support/DynamicLibrary/CMakeLists.txt
llvm/trunk/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
llvm/trunk/unittests/Support/DynamicLibrary/ExportedFuncs.cxx
llvm/trunk/unittests/Support/DynamicLibrary/PipSqueak.cxx
llvm/trunk/unittests/Support/DynamicLibrary/PipSqueak.h
Index: llvm/trunk/unittests/Support/DynamicLibrary/CMakeLists.txt
===================================================================
--- llvm/trunk/unittests/Support/DynamicLibrary/CMakeLists.txt
+++ llvm/trunk/unittests/Support/DynamicLibrary/CMakeLists.txt
@@ -1,7 +1,9 @@
set(LLVM_LINK_COMPONENTS Support)
-add_llvm_unittest(DynamicLibraryTests DynamicLibraryTest.cpp)
+add_library(DynamicLibraryLib STATIC ExportedFuncs.cxx)
+add_llvm_unittest(DynamicLibraryTests DynamicLibraryTest.cpp)
+target_link_libraries(DynamicLibraryTests DynamicLibraryLib)
export_executable_symbols(DynamicLibraryTests)
function(dynlib_add_module NAME)
Index: llvm/trunk/unittests/Support/DynamicLibrary/ExportedFuncs.cxx
===================================================================
--- llvm/trunk/unittests/Support/DynamicLibrary/ExportedFuncs.cxx
+++ llvm/trunk/unittests/Support/DynamicLibrary/ExportedFuncs.cxx
@@ -0,0 +1,16 @@
+//===- 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.
+//
+//===----------------------------------------------------------------------===//
+
+#include "PipSqueak.h"
+
+#ifndef PIPSQUEAK_TESTA_RETURN
+#define PIPSQUEAK_TESTA_RETURN "ProcessCall"
+#endif
+
+extern "C" PIPSQUEAK_EXPORT const char *TestA() { return PIPSQUEAK_TESTA_RETURN; }
Index: llvm/trunk/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
===================================================================
--- llvm/trunk/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
+++ llvm/trunk/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
@@ -19,8 +19,6 @@
using namespace llvm;
using namespace llvm::sys;
-extern "C" PIPSQUEAK_EXPORT const char *TestA() { return "ProcessCall"; }
-
std::string LibPath(const std::string Name = "PipSqueak") {
const std::vector<testing::internal::string>& Argvs = testing::internal::GetArgvs();
const char *Argv0 = Argvs.size() > 0 ? Argvs[0].c_str() : "DynamicLibraryTests";
Index: llvm/trunk/unittests/Support/DynamicLibrary/PipSqueak.h
===================================================================
--- llvm/trunk/unittests/Support/DynamicLibrary/PipSqueak.h
+++ llvm/trunk/unittests/Support/DynamicLibrary/PipSqueak.h
@@ -29,4 +29,6 @@
#define PIPSQUEAK_EXPORT
#endif
+extern "C" PIPSQUEAK_EXPORT const char *TestA();
+
#endif
Index: llvm/trunk/unittests/Support/DynamicLibrary/PipSqueak.cxx
===================================================================
--- llvm/trunk/unittests/Support/DynamicLibrary/PipSqueak.cxx
+++ llvm/trunk/unittests/Support/DynamicLibrary/PipSqueak.cxx
@@ -45,4 +45,5 @@
Glb.Vec = &V;
}
-extern "C" PIPSQUEAK_EXPORT const char *TestA() { return "LibCall"; }
+#define PIPSQUEAK_TESTA_RETURN "LibCall"
+#include "ExportedFuncs.cxx"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33789.102156.patch
Type: text/x-patch
Size: 2949 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170612/b06a55b3/attachment.bin>
More information about the llvm-commits
mailing list