diff options
Diffstat (limited to 'llvm/unittests')
| -rw-r--r-- | llvm/unittests/ExecutionEngine/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | llvm/unittests/ExecutionEngine/Makefile | 4 | ||||
| -rw-r--r-- | llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt | 8 | ||||
| -rw-r--r-- | llvm/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp | 30 | ||||
| -rw-r--r-- | llvm/unittests/ExecutionEngine/Orc/Makefile | 16 |
5 files changed, 60 insertions, 1 deletions
diff --git a/llvm/unittests/ExecutionEngine/CMakeLists.txt b/llvm/unittests/ExecutionEngine/CMakeLists.txt index 05e093e0c0b..302de9943ff 100644 --- a/llvm/unittests/ExecutionEngine/CMakeLists.txt +++ b/llvm/unittests/ExecutionEngine/CMakeLists.txt @@ -3,6 +3,7 @@ set(LLVM_LINK_COMPONENTS ExecutionEngine Interpreter MC + OrcJIT RuntimeDyld Support ) @@ -11,6 +12,8 @@ add_llvm_unittest(ExecutionEngineTests ExecutionEngineTest.cpp ) +add_subdirectory(Orc) + # Include MCJIT tests only if native arch is a built JIT target. list(FIND LLVM_TARGETS_TO_BUILD "${LLVM_NATIVE_ARCH}" build_idx) list(FIND LLVM_TARGETS_WITH_JIT "${LLVM_NATIVE_ARCH}" jit_idx) diff --git a/llvm/unittests/ExecutionEngine/Makefile b/llvm/unittests/ExecutionEngine/Makefile index 8ecb883ba9d..1c7a125af28 100644 --- a/llvm/unittests/ExecutionEngine/Makefile +++ b/llvm/unittests/ExecutionEngine/Makefile @@ -13,8 +13,10 @@ LINK_COMPONENTS :=interpreter include $(LEVEL)/Makefile.config +PARALLEL_DIRS = Orc + ifeq ($(TARGET_HAS_JIT),1) - PARALLEL_DIRS = MCJIT + PARALLEL_DIRS = $(PARALLEL_DIRS) MCJIT endif include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest diff --git a/llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt b/llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt new file mode 100644 index 00000000000..7bc13a17524 --- /dev/null +++ b/llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt @@ -0,0 +1,8 @@ +set(LLVM_LINK_COMPONENTS + Core + Support + ) + +add_llvm_unittest(OrcJITTests + LazyEmittingLayerTest.cpp + ) diff --git a/llvm/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp new file mode 100644 index 00000000000..b0ff1276c5c --- /dev/null +++ b/llvm/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp @@ -0,0 +1,30 @@ +//===- LazyEmittingLayerTest.cpp - Unit tests for the lazy emitting layer -===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "llvm/ExecutionEngine/Orc/LazyEmittingLayer.h" +#include "gtest/gtest.h" + +namespace { + +struct MockBaseLayer { + typedef int ModuleSetHandleT; + ModuleSetHandleT addModuleSet(std::list<std::unique_ptr<llvm::Module>>, + std::unique_ptr<llvm::RTDyldMemoryManager> x) { + EXPECT_FALSE(x); + return 42; + } +}; + +TEST(LazyEmittingLayerTest, Empty) { + MockBaseLayer M; + llvm::orc::LazyEmittingLayer<MockBaseLayer> L(M); + L.addModuleSet(std::list<std::unique_ptr<llvm::Module>>(), nullptr); +} + +} diff --git a/llvm/unittests/ExecutionEngine/Orc/Makefile b/llvm/unittests/ExecutionEngine/Orc/Makefile new file mode 100644 index 00000000000..c899728e507 --- /dev/null +++ b/llvm/unittests/ExecutionEngine/Orc/Makefile @@ -0,0 +1,16 @@ +##===- unittests/ExecutionEngine/Orc/Makefile --------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +LEVEL = ../../.. +TESTNAME = OrcJIT +LINK_COMPONENTS := core ipo mcjit orcjit native support + +include $(LEVEL)/Makefile.config +include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest + |

