summaryrefslogtreecommitdiffstats
path: root/unittests/ExecutionEngine
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/ExecutionEngine')
-rw-r--r--unittests/ExecutionEngine/CMakeLists.txt9
-rw-r--r--unittests/ExecutionEngine/JIT/CMakeLists.txt57
-rw-r--r--unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp2
-rw-r--r--unittests/ExecutionEngine/JIT/JITEventListenerTestCommon.h14
-rw-r--r--unittests/ExecutionEngine/JIT/JITTest.cpp32
-rw-r--r--unittests/ExecutionEngine/JIT/Makefile2
-rw-r--r--unittests/ExecutionEngine/Makefile2
7 files changed, 93 insertions, 25 deletions
diff --git a/unittests/ExecutionEngine/CMakeLists.txt b/unittests/ExecutionEngine/CMakeLists.txt
new file mode 100644
index 0000000..5fffadd
--- /dev/null
+++ b/unittests/ExecutionEngine/CMakeLists.txt
@@ -0,0 +1,9 @@
+set(LLVM_LINK_COMPONENTS
+ interpreter
+ )
+
+add_llvm_unittest(ExecutionEngineTests
+ ExecutionEngineTest.cpp
+ )
+
+add_subdirectory(JIT)
diff --git a/unittests/ExecutionEngine/JIT/CMakeLists.txt b/unittests/ExecutionEngine/JIT/CMakeLists.txt
new file mode 100644
index 0000000..d43d72d
--- /dev/null
+++ b/unittests/ExecutionEngine/JIT/CMakeLists.txt
@@ -0,0 +1,57 @@
+set(LLVM_LINK_COMPONENTS
+ asmparser
+ bitreader
+ bitwriter
+ jit
+ nativecodegen
+ )
+
+# HACK: Declare a couple of source files as optionally compiled to satisfy the
+# missing-file-checker in LLVM's weird CMake build.
+set(LLVM_OPTIONAL_SOURCES
+ IntelJITEventListenerTest.cpp
+ OProfileJITEventListenerTest.cpp
+ )
+
+if( LLVM_USE_INTEL_JITEVENTS )
+ include_directories( ${LLVM_INTEL_JITEVENTS_INCDIR} )
+ link_directories( ${LLVM_INTEL_JITEVENTS_LIBDIR} )
+ set(ProfileTestSources
+ IntelJITEventListenerTest.cpp
+ )
+ set(LLVM_LINK_COMPONENTS
+ ${LLVM_LINK_COMPONENTS}
+ IntelJITEvents
+ )
+endif( LLVM_USE_INTEL_JITEVENTS )
+
+if( LLVM_USE_OPROFILE )
+ set(ProfileTestSources
+ ${ProfileTestSources}
+ OProfileJITEventListenerTest.cpp
+ )
+ set(LLVM_LINK_COMPONENTS
+ ${LLVM_LINK_COMPONENTS}
+ OProfileJIT
+ )
+endif( LLVM_USE_OPROFILE )
+
+set(JITTestsSources
+ JITEventListenerTest.cpp
+ JITMemoryManagerTest.cpp
+ JITTest.cpp
+ MultiJITTest.cpp
+ ${ProfileTestSources}
+ )
+
+if(MSVC)
+ list(APPEND JITTestsSources JITTests.def)
+endif()
+
+add_llvm_unittest(JITTests
+ ${JITTestsSources}
+ )
+
+if(MINGW OR CYGWIN)
+ set_property(TARGET JITTests PROPERTY LINK_FLAGS -Wl,--export-all-symbols)
+endif()
diff --git a/unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp b/unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp
index f8d8830..333888a 100644
--- a/unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp
+++ b/unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp
@@ -12,10 +12,10 @@
#include "llvm/LLVMContext.h"
#include "llvm/Instructions.h"
#include "llvm/Module.h"
+#include "llvm/TypeBuilder.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/CodeGen/MachineCodeInfo.h"
#include "llvm/ExecutionEngine/JIT.h"
-#include "llvm/Support/TypeBuilder.h"
#include "llvm/Support/TargetSelect.h"
#include "gtest/gtest.h"
#include <vector>
diff --git a/unittests/ExecutionEngine/JIT/JITEventListenerTestCommon.h b/unittests/ExecutionEngine/JIT/JITEventListenerTestCommon.h
index 53608cb..5f02b38 100644
--- a/unittests/ExecutionEngine/JIT/JITEventListenerTestCommon.h
+++ b/unittests/ExecutionEngine/JIT/JITEventListenerTestCommon.h
@@ -10,18 +10,18 @@
#ifndef JIT_EVENT_LISTENER_TEST_COMMON_H
#define JIT_EVENT_LISTENER_TEST_COMMON_H
-#include "llvm/Analysis/DIBuilder.h"
-#include "llvm/Analysis/DebugInfo.h"
+#include "llvm/DIBuilder.h"
+#include "llvm/DebugInfo.h"
+#include "llvm/IRBuilder.h"
+#include "llvm/Instructions.h"
+#include "llvm/Module.h"
+#include "llvm/TypeBuilder.h"
#include "llvm/CodeGen/MachineCodeInfo.h"
-#include "llvm/Config/config.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/ExecutionEngine/JITEventListener.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/Support/IRBuilder.h"
#include "llvm/Support/Dwarf.h"
-#include "llvm/Support/TypeBuilder.h"
#include "llvm/Support/TargetSelect.h"
+#include "llvm/Config/config.h"
#include "gtest/gtest.h"
diff --git a/unittests/ExecutionEngine/JIT/JITTest.cpp b/unittests/ExecutionEngine/JIT/JITTest.cpp
index fa52321..89f7e8e 100644
--- a/unittests/ExecutionEngine/JIT/JITTest.cpp
+++ b/unittests/ExecutionEngine/JIT/JITTest.cpp
@@ -7,29 +7,29 @@
//
//===----------------------------------------------------------------------===//
-#include "gtest/gtest.h"
-#include "llvm/ADT/OwningPtr.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/Assembly/Parser.h"
#include "llvm/BasicBlock.h"
-#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/Constant.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
-#include "llvm/ExecutionEngine/JIT.h"
-#include "llvm/ExecutionEngine/JITMemoryManager.h"
#include "llvm/Function.h"
#include "llvm/GlobalValue.h"
#include "llvm/GlobalVariable.h"
+#include "llvm/IRBuilder.h"
#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
-#include "llvm/Support/IRBuilder.h"
+#include "llvm/Type.h"
+#include "llvm/TypeBuilder.h"
+#include "llvm/ADT/OwningPtr.h"
+#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/Assembly/Parser.h"
+#include "llvm/Bitcode/ReaderWriter.h"
+#include "llvm/ExecutionEngine/JIT.h"
+#include "llvm/ExecutionEngine/JITMemoryManager.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SourceMgr.h"
-#include "llvm/Support/TypeBuilder.h"
#include "llvm/Support/TargetSelect.h"
-#include "llvm/Type.h"
+#include "gtest/gtest.h"
#include <vector>
using namespace llvm;
@@ -477,10 +477,11 @@ TEST_F(JITTest, ModuleDeletion) {
}
#endif // !defined(__arm__)
-// ARM 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
+// 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
// http://llvm.org/PR5201 is fixed.
-#if !defined(__arm__) && !defined(__powerpc__) && !defined(__ppc__)
+#if !defined(__arm__) && !defined(__mips__) && \
+ !defined(__powerpc__) && !defined(__ppc__)
typedef int (*FooPtr) ();
TEST_F(JITTest, NoStubs) {
@@ -554,8 +555,9 @@ TEST_F(JITTest, FunctionPointersOutliveTheirCreator) {
#endif
}
-// ARM doesn't have an implementation of replaceMachineCodeForFunction(), so
-// recompileAndRelinkFunction doesn't work.
+// ARM does not have an implementation
+// of replaceMachineCodeForFunction(), so recompileAndRelinkFunction
+// doesn't work.
#if !defined(__arm__)
TEST_F(JITTest, FunctionIsRecompiledAndRelinked) {
Function *F = Function::Create(TypeBuilder<int(void), false>::get(Context),
diff --git a/unittests/ExecutionEngine/JIT/Makefile b/unittests/ExecutionEngine/JIT/Makefile
index c404fb0..b535a6b 100644
--- a/unittests/ExecutionEngine/JIT/Makefile
+++ b/unittests/ExecutionEngine/JIT/Makefile
@@ -9,7 +9,7 @@
LEVEL = ../../..
TESTNAME = JIT
-LINK_COMPONENTS := asmparser bitreader bitwriter core jit native support
+LINK_COMPONENTS := asmparser bitreader bitwriter jit native
include $(LEVEL)/Makefile.config
diff --git a/unittests/ExecutionEngine/Makefile b/unittests/ExecutionEngine/Makefile
index a0395cd..63508d2 100644
--- a/unittests/ExecutionEngine/Makefile
+++ b/unittests/ExecutionEngine/Makefile
@@ -9,7 +9,7 @@
LEVEL = ../..
TESTNAME = ExecutionEngine
-LINK_COMPONENTS := engine interpreter
+LINK_COMPONENTS :=interpreter
PARALLEL_DIRS = JIT
include $(LEVEL)/Makefile.config
OpenPOWER on IntegriCloud