diff options
Diffstat (limited to 'unittests/ExecutionEngine/Orc')
-rw-r--r-- | unittests/ExecutionEngine/Orc/CMakeLists.txt | 8 | ||||
-rw-r--r-- | unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp | 30 | ||||
-rw-r--r-- | unittests/ExecutionEngine/Orc/Makefile | 16 |
3 files changed, 54 insertions, 0 deletions
diff --git a/unittests/ExecutionEngine/Orc/CMakeLists.txt b/unittests/ExecutionEngine/Orc/CMakeLists.txt new file mode 100644 index 0000000..7bc13a1 --- /dev/null +++ b/unittests/ExecutionEngine/Orc/CMakeLists.txt @@ -0,0 +1,8 @@ +set(LLVM_LINK_COMPONENTS + Core + Support + ) + +add_llvm_unittest(OrcJITTests + LazyEmittingLayerTest.cpp + ) diff --git a/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp b/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp new file mode 100644 index 0000000..b0ff127 --- /dev/null +++ b/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/unittests/ExecutionEngine/Orc/Makefile b/unittests/ExecutionEngine/Orc/Makefile new file mode 100644 index 0000000..c899728 --- /dev/null +++ b/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 + |