aboutsummaryrefslogtreecommitdiffstats
path: root/unittests/ExecutionEngine
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2013-05-20 06:13:09 +0000
committerBob Wilson <bob.wilson@apple.com>2013-05-20 06:13:09 +0000
commita4de3f2c85a5e74e0412283693b9764b7190c766 (patch)
tree257c2081b8d57cfed8ee8c391be076786f0619d2 /unittests/ExecutionEngine
parent89f530ebbfa91d1583a72d86dc6ca2804f4f450d (diff)
downloadexternal_llvm-a4de3f2c85a5e74e0412283693b9764b7190c766.zip
external_llvm-a4de3f2c85a5e74e0412283693b9764b7190c766.tar.gz
external_llvm-a4de3f2c85a5e74e0412283693b9764b7190c766.tar.bz2
Partially revert change in r181200 that tried to simplify JIT unit test #ifdefs.
The export list for this test requires the following symbols to be available: JITTest_AvailableExternallyFunction JITTest_AvailableExternallyGlobal The change in r181200 commented them out, which caused the test to fail to link, at least on Darwin. I have only reverted the change for arm, since I can't test the other targets and since it sounds like that change was fixing real problems for those other targets. It should be possible to rearrange the code to keep those definitions outside the #ifdefs, but that should be done by someone who can reproduce the problems that r181200 was trying to fix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182233 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ExecutionEngine')
-rw-r--r--unittests/ExecutionEngine/JIT/JITTest.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/unittests/ExecutionEngine/JIT/JITTest.cpp b/unittests/ExecutionEngine/JIT/JITTest.cpp
index f8d9da2..18063d1 100644
--- a/unittests/ExecutionEngine/JIT/JITTest.cpp
+++ b/unittests/ExecutionEngine/JIT/JITTest.cpp
@@ -35,8 +35,8 @@ using namespace llvm;
namespace {
-// Tests on ARM, PowerPC and SystemZ disabled as we're running the old jit
-#if !defined(__arm__) && !defined(__powerpc__) && !defined(__s390__)
+// Tests on PowerPC and SystemZ disabled as we're running the old jit
+#if !defined(__powerpc__) && !defined(__s390__)
Function *makeReturnGlobal(std::string Name, GlobalVariable *G, Module *M) {
std::vector<Type*> params;
@@ -185,6 +185,9 @@ class JITTest : public testing::Test {
OwningPtr<ExecutionEngine> TheJIT;
};
+// Tests on ARM disabled as we're running the old jit
+#if !defined(__arm__)
+
// Regression test for a bug. The JIT used to allocate globals inside the same
// memory block used for the function, and when the function code was freed,
// the global was left in the same place. This test allocates a function
@@ -253,6 +256,11 @@ TEST(JIT, GlobalInFunction) {
EXPECT_EQ(3, *GPtr);
}
+#endif // !defined(__arm__)
+
+// ARM tests disabled pending fix for PR10783.
+#if !defined(__arm__)
+
int PlusOne(int arg) {
return arg + 1;
}
@@ -413,6 +421,7 @@ TEST_F(JITTest, ModuleDeletion) {
EXPECT_EQ(RJMM->startFunctionBodyCalls.size(),
RJMM->deallocateFunctionBodyCalls.size());
}
+#endif // !defined(__arm__)
// ARM, MIPS and PPC still emit stubs for calls since the target may be
// too far away to call directly. This #if can probably be removed when
@@ -458,6 +467,9 @@ TEST_F(JITTest, NoStubs) {
}
#endif // !ARM && !PPC
+// Tests on ARM disabled as we're running the old jit
+#if !defined(__arm__)
+
TEST_F(JITTest, FunctionPointersOutliveTheirCreator) {
TheJIT->DisableLazyCompilation(true);
LoadAssembly("define i8()* @get_foo_addr() { "
@@ -492,6 +504,9 @@ TEST_F(JITTest, FunctionPointersOutliveTheirCreator) {
#endif
}
+#endif //!defined(__arm__)
+
+// Tests on ARM disabled as we're running the old jit. In addition,
// ARM does not have an implementation of replaceMachineCodeForFunction(),
// so recompileAndRelinkFunction doesn't work.
#if !defined(__arm__)
@@ -535,6 +550,9 @@ extern "C" int32_t JITTest_AvailableExternallyGlobal;
int32_t JITTest_AvailableExternallyGlobal LLVM_ATTRIBUTE_USED = 42;
namespace {
+// Tests on ARM disabled as we're running the old jit
+#if !defined(__arm__)
+
TEST_F(JITTest, AvailableExternallyGlobalIsntEmitted) {
TheJIT->DisableLazyCompilation(true);
LoadAssembly("@JITTest_AvailableExternallyGlobal = "
@@ -551,6 +569,7 @@ TEST_F(JITTest, AvailableExternallyGlobalIsntEmitted) {
EXPECT_EQ(42, loader()) << "func should return 42 from the external global,"
<< " not 7 from the IR version.";
}
+#endif //!defined(__arm__)
} // anonymous namespace
// This function 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
@@ -561,6 +580,8 @@ extern "C" int32_t JITTest_AvailableExternallyFunction() {
}
namespace {
+// ARM tests disabled pending fix for PR10783.
+#if !defined(__arm__)
TEST_F(JITTest, AvailableExternallyFunctionIsntCompiled) {
TheJIT->DisableLazyCompilation(true);
LoadAssembly("define available_externally i32 "
@@ -716,7 +737,8 @@ TEST(LazyLoadedJITTest, EagerCompiledRecursionThroughGhost) {
(intptr_t)TheJIT->getPointerToFunction(recur1IR));
EXPECT_EQ(3, recur1(4));
}
-#endif // !defined(__arm__) && !defined(__powerpc__) && !defined(__s390__)
+#endif // !defined(__arm__)
+#endif // !defined(__powerpc__) && !defined(__s390__)
// 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