//===----------------------------------------------------------------------===//
#include "llvm/ExecutionEngine/JITEventListener.h"
-
-#include "llvm/LLVMContext.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/ADT/OwningPtr.h"
#include "llvm/CodeGen/MachineCodeInfo.h"
#include "llvm/ExecutionEngine/JIT.h"
-#include "llvm/Support/TypeBuilder.h"
-#include "llvm/Target/TargetSelect.h"
+#include "llvm/IR/Instructions.h"
+#include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/Module.h"
+#include "llvm/IR/TypeBuilder.h"
+#include "llvm/Support/TargetSelect.h"
#include "gtest/gtest.h"
#include <vector>
};
struct FunctionFreedEvent {
unsigned Index;
- const Function *F;
void *Code;
};
std::vector<FunctionEmittedEvent> EmittedEvents;
std::vector<FunctionFreedEvent> FreedEvents;
- int NextIndex;
+ unsigned NextIndex;
RecordingJITEventListener() : NextIndex(0) {}
EmittedEvents.push_back(Event);
}
- virtual void NotifyFreeingMachineCode(const Function &F, void *OldPtr) {
- FunctionFreedEvent Event = {NextIndex++, &F, OldPtr};
+ virtual void NotifyFreeingMachineCode(void *OldPtr) {
+ FunctionFreedEvent Event = {NextIndex++, OldPtr};
FreedEvents.push_back(Event);
}
};
}
Module *M;
- const OwningPtr<ExecutionEngine> EE;
+ const std::unique_ptr<ExecutionEngine> EE;
};
+// Tests on SystemZ disabled as we're running the old JIT
+#if !defined(__s390__) && !defined(__aarch64__)
Function *buildFunction(Module *M) {
Function *Result = Function::Create(
TypeBuilder<int32_t(int32_t), false>::get(getGlobalContext()),
<< " contain some bytes.";
EXPECT_EQ(2U, Listener.FreedEvents[0].Index);
- EXPECT_EQ(F1, Listener.FreedEvents[0].F);
EXPECT_EQ(F1_addr, Listener.FreedEvents[0].Code);
EXPECT_EQ(3U, Listener.FreedEvents[1].Index);
- EXPECT_EQ(F2, Listener.FreedEvents[1].F);
EXPECT_EQ(F2_addr, Listener.FreedEvents[1].Code);
F1->eraseFromParent();
<< " contain some bytes.";
EXPECT_EQ(1U, Listener1.FreedEvents[0].Index);
- EXPECT_EQ(F2, Listener1.FreedEvents[0].F);
EXPECT_EQ(F2_addr, Listener1.FreedEvents[0].Code);
// Listener 2.
<< " contain some bytes.";
EXPECT_EQ(2U, Listener2.FreedEvents[0].Index);
- EXPECT_EQ(F2, Listener2.FreedEvents[0].F);
EXPECT_EQ(F2_addr, Listener2.FreedEvents[0].Code);
// Listener 3.
<< " contain some bytes.";
EXPECT_EQ(1U, Listener3.FreedEvents[0].Index);
- EXPECT_EQ(F2, Listener3.FreedEvents[0].F);
EXPECT_EQ(F2_addr, Listener3.FreedEvents[0].Code);
F1->eraseFromParent();
EXPECT_EQ(MCI.size(), Listener.EmittedEvents[0].Size);
EXPECT_EQ(1U, Listener.FreedEvents[0].Index);
- EXPECT_EQ(F, Listener.FreedEvents[0].F);
EXPECT_EQ(F_addr, Listener.FreedEvents[0].Code);
}
+#endif
class JITEnvironment : public testing::Environment {
virtual void SetUp() {