Revert 94484. Re-disable unittests that need RTTI.
authorBob Wilson <bob.wilson@apple.com>
Tue, 26 Jan 2010 19:04:37 +0000 (19:04 +0000)
committerBob Wilson <bob.wilson@apple.com>
Tue, 26 Jan 2010 19:04:37 +0000 (19:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94569 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp
unittests/ExecutionEngine/JIT/JITTest.cpp
unittests/Makefile.unittest
unittests/VMCore/PassManagerTest.cpp

index c3bb85897585c390be5fb4d7bb9b1b8b2d98f4da..a58a0872a4ec9a1a4b373937bc64f88c44564a2b 100644 (file)
@@ -25,6 +25,7 @@ using namespace llvm;
 
 int dummy;
 
+#if 0
 namespace {
 
 struct FunctionEmittedEvent {
@@ -237,3 +238,4 @@ testing::Environment* const jit_env =
   testing::AddGlobalTestEnvironment(new JITEnvironment);
 
 }  // anonymous namespace
+#endif
index 7f75afada1aa3dcee3645174a545a412cc1df932..bed2d22f1cfa01e3146eabbe88a1cb36ba38ec5d 100644 (file)
@@ -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
 
index 65638b2a4f6c365f5f9e1a736c957b3da730a162..656f5e2f412a35a724c0f4823f05de6e4d1b558f 100644 (file)
 # Set up variables for building a unit test.
 ifdef TESTNAME
 
-CXXFLAGS += -DGTEST_HAS_RTTI=0
-# gcc's TR1 <tuple> header depends on RTTI, so force googletest to use
-# its own tuple implementation.  When we import googletest >=1.4.0, we
-# can drop this line.
-CXXFLAGS += -DGTEST_HAS_TR1_TUPLE=0
+REQUIRES_RTTI = 1
 
 include $(LEVEL)/Makefile.common
 
index cb8f9ebb939beb4dafaf373d25226f9a9d1313f2..092ce3d928b2390e210d03d39e0b61f0893796d7 100644 (file)
 #include "llvm/Assembly/PrintModulePass.h"
 #include "gtest/gtest.h"
 
+int dummy;
+
+#if 0
+
 namespace llvm {
   namespace {
     // ND = no deps
@@ -525,3 +529,4 @@ namespace llvm {
 
   }
 }
+#endif