Revert r91208. Something on Linux prevents the JIT from looking up a symbol
authorJeffrey Yasskin <jyasskin@google.com>
Sat, 12 Dec 2009 06:18:46 +0000 (06:18 +0000)
committerJeffrey Yasskin <jyasskin@google.com>
Sat, 12 Dec 2009 06:18:46 +0000 (06:18 +0000)
defined in the test, and I don't have time tonight to figure it out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91209 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/JIT/JIT.cpp
unittests/ExecutionEngine/JIT/JITTest.cpp

index 3607f1fcb09f09fd0e73fe7bd4bf93531d9b404e..6d781c7e22cd1c3c7f3749f026a8f68537db45d5 100644 (file)
@@ -681,7 +681,7 @@ void *JIT::getOrEmitGlobalVariable(const GlobalVariable *GV) {
   if (Ptr) return Ptr;
 
   // If the global is external, just remember the address.
-  if (GV->isDeclaration() || GV->hasAvailableExternallyLinkage()) {
+  if (GV->isDeclaration()) {
 #if HAVE___DSO_HANDLE
     if (GV->getName() == "__dso_handle")
       return (void*)&__dso_handle;
index bbf34603872d62a5759586952f6a0810cdb4969b..12c6b67d987543b5b4af8006e090d3dfe2616698 100644 (file)
@@ -534,31 +534,6 @@ TEST_F(JITTest, FunctionPointersOutliveTheirCreator) {
 #endif
 }
 
-}  // anonymous namespace
-// This variable is intentionally defined differently in the statically-compiled
-// program from the IR input to the JIT to assert that the JIT doesn't use its
-// definition.
-extern "C" int32_t JITTest_AvailableExternallyGlobal;
-int32_t JITTest_AvailableExternallyGlobal = 42;
-namespace {
-
-TEST_F(JITTest, AvailableExternallyGlobalIsntEmitted) {
-  TheJIT->DisableLazyCompilation(true);
-  LoadAssembly("@JITTest_AvailableExternallyGlobal = "
-               "  available_externally global i32 7 "
-               " "
-               "define i32 @loader() { "
-               "  %result = load i32* @JITTest_AvailableExternallyGlobal "
-               "  ret i32 %result "
-               "} ");
-  Function *loaderIR = M->getFunction("loader");
-
-  int32_t (*loader)() = reinterpret_cast<int32_t(*)()>(
-    (intptr_t)TheJIT->getPointerToFunction(loaderIR));
-  EXPECT_EQ(42, loader()) << "func should return 42 from the external global,"
-                          << " not 7 from the IR version.";
-}
-
 // This code is copied from JITEventListenerTest, but it only runs once for all
 // the tests in this directory.  Everything seems fine, but that's strange
 // behavior.