diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-01-23 11:09:33 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-01-23 11:09:33 +0000 |
commit | 3fd58f91dd318518f7daa4ba64c0aaf31799d89b (patch) | |
tree | 74eecbae571601ec6a626a53374b1eddc7b164a5 /unittests/ExecutionEngine/JIT/JITTest.cpp | |
parent | 3fba7d16b41dfbefe3b1be6bc0ab94c017728f79 (diff) | |
download | FreeBSD-src-3fd58f91dd318518f7daa4ba64c0aaf31799d89b.zip FreeBSD-src-3fd58f91dd318518f7daa4ba64c0aaf31799d89b.tar.gz |
Update LLVM to r94309.
Diffstat (limited to 'unittests/ExecutionEngine/JIT/JITTest.cpp')
-rw-r--r-- | unittests/ExecutionEngine/JIT/JITTest.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/unittests/ExecutionEngine/JIT/JITTest.cpp b/unittests/ExecutionEngine/JIT/JITTest.cpp index 7f75afa..bed2d22 100644 --- a/unittests/ExecutionEngine/JIT/JITTest.cpp +++ b/unittests/ExecutionEngine/JIT/JITTest.cpp @@ -58,6 +58,7 @@ std::string DumpFunction(const Function *F) { return Result; } +#if 0 class RecordingJITMemoryManager : public JITMemoryManager { const OwningPtr<JITMemoryManager> Base; public: @@ -178,6 +179,7 @@ public: return Base->endExceptionTable(F, TableStart, TableEnd, FrameRegister); } }; +#endif bool LoadAssemblyInto(Module *M, const char *assembly) { SMDiagnostic Error; @@ -195,11 +197,15 @@ class JITTest : public testing::Test { virtual void SetUp() { M = new Module("<main>", Context); MP = new ExistingModuleProvider(M); +#if 0 RJMM = new RecordingJITMemoryManager; RJMM->setPoisonMemory(true); +#endif std::string Error; TheJIT.reset(EngineBuilder(MP).setEngineKind(EngineKind::JIT) +#if 0 .setJITMemoryManager(RJMM) +#endif .setErrorStr(&Error).create()); ASSERT_TRUE(TheJIT.get() != NULL) << Error; } @@ -211,7 +217,9 @@ class JITTest : public testing::Test { LLVMContext Context; Module *M; // Owned by MP. ModuleProvider *MP; // Owned by ExecutionEngine. +#if 0 RecordingJITMemoryManager *RJMM; +#endif OwningPtr<ExecutionEngine> TheJIT; }; @@ -430,6 +438,7 @@ TEST_F(JITTest, ModuleDeletion) { TheJIT->getPointerToFunction(func); TheJIT->deleteModuleProvider(MP); +#if 0 SmallPtrSet<const void*, 2> FunctionsDeallocated; for (unsigned i = 0, e = RJMM->deallocateFunctionBodyCalls.size(); i != e; ++i) { @@ -463,6 +472,7 @@ TEST_F(JITTest, ModuleDeletion) { } EXPECT_EQ(RJMM->startExceptionTableCalls.size(), NumTablesDeallocated); +#endif } // ARM and PPC still emit stubs for calls since the target may be too far away @@ -497,14 +507,18 @@ TEST_F(JITTest, NoStubs) { // We should now allocate no more stubs, we have the code to foo // and the existing stub for bar. +#if 0 int stubsBefore = RJMM->stubsAllocated; +#endif Function *func = M->getFunction("main"); TheJIT->getPointerToFunction(func); Function *bar = M->getFunction("bar"); TheJIT->getPointerToFunction(bar); +#if 0 ASSERT_EQ(stubsBefore, RJMM->stubsAllocated); +#endif } #endif // !ARM && !PPC |