[llvm-commits] [llvm] r167146 - /llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp

Amara Emerson amara.emerson at arm.com
Wed Oct 31 10:44:17 PDT 2012


Author: aemerson
Date: Wed Oct 31 12:44:16 2012
New Revision: 167146

URL: http://llvm.org/viewvc/llvm-project?rev=167146&view=rev
Log:
MCJIT unit test: add calls to ensure that instruction caches are properly invalidated before code execution.

Modified:
    llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp

Modified: llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp?rev=167146&r1=167145&r2=167146&view=diff
==============================================================================
--- llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp (original)
+++ llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp Wed Oct 31 12:44:16 2012
@@ -47,6 +47,7 @@
   GlobalValue *Global = insertGlobalInt32(M.get(), "test_global", initialValue);
   createJIT(M.take());
   void *globalPtr =  TheJIT->getPointerToGlobal(Global);
+  static_cast<SectionMemoryManager*>(MM)->invalidateInstructionCache();
   EXPECT_TRUE(0 != globalPtr)
     << "Unable to get pointer to global value from JIT";
 
@@ -60,6 +61,7 @@
   Function *F = insertAddFunction(M.get());
   createJIT(M.take());
   void *addPtr = TheJIT->getPointerToFunction(F);
+  static_cast<SectionMemoryManager*>(MM)->invalidateInstructionCache();
   EXPECT_TRUE(0 != addPtr)
     << "Unable to get pointer to function from JIT";
 
@@ -76,6 +78,7 @@
   Function *Main = insertMainFunction(M.get(), 6);
   createJIT(M.take());
   void *vPtr = TheJIT->getPointerToFunction(Main);
+  static_cast<SectionMemoryManager*>(MM)->invalidateInstructionCache();
   EXPECT_TRUE(0 != vPtr)
     << "Unable to get pointer to main() from JIT";
 
@@ -97,6 +100,7 @@
 
   createJIT(M.take());
   void *rgvPtr = TheJIT->getPointerToFunction(ReturnGlobal);
+  static_cast<SectionMemoryManager*>(MM)->invalidateInstructionCache();
   EXPECT_TRUE(0 != rgvPtr);
 
   int32_t(*FuncPtr)(void) = (int32_t(*)(void))(intptr_t)rgvPtr;
@@ -165,6 +169,7 @@
 
   createJIT(M.take());
   void *vPtr = TheJIT->getPointerToFunction(Outer);
+  static_cast<SectionMemoryManager*>(MM)->invalidateInstructionCache();
   EXPECT_TRUE(0 != vPtr)
     << "Unable to get pointer to outer function from JIT";
 





More information about the llvm-commits mailing list