summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/DynamicLibrary/PipSqueak.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Support/DynamicLibrary/PipSqueak.cxx')
-rw-r--r--llvm/unittests/Support/DynamicLibrary/PipSqueak.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/llvm/unittests/Support/DynamicLibrary/PipSqueak.cxx b/llvm/unittests/Support/DynamicLibrary/PipSqueak.cxx
index 375d72c0b53..0c2ec0010af 100644
--- a/llvm/unittests/Support/DynamicLibrary/PipSqueak.cxx
+++ b/llvm/unittests/Support/DynamicLibrary/PipSqueak.cxx
@@ -8,6 +8,10 @@
//===----------------------------------------------------------------------===//
#include "PipSqueak.h"
+#include "llvm/Transforms/IPO/PassManagerBuilder.h"
+
+#define PIPSQUEAK_TESTA_RETURN "LibCall"
+#include "ExportedFuncs.cxx"
struct Global {
std::string *Str;
@@ -45,5 +49,13 @@ extern "C" PIPSQUEAK_EXPORT void TestOrder(std::vector<std::string> &V) {
Glb.Vec = &V;
}
-#define PIPSQUEAK_TESTA_RETURN "LibCall"
-#include "ExportedFuncs.cxx"
+
+static void LibPassRegistration(const llvm::PassManagerBuilder &,
+ llvm::legacy::PassManagerBase &) {}
+
+extern "C" PIPSQUEAK_EXPORT void TestPassReg(
+ void (*addGlobalExtension)(llvm::PassManagerBuilder::ExtensionPointTy,
+ llvm::PassManagerBuilder::ExtensionProc)) {
+ addGlobalExtension(llvm::PassManagerBuilder::EP_EarlyAsPossible,
+ LibPassRegistration);
+}
OpenPOWER on IntegriCloud