summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ExecutionEngine/Orc
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-02-23 00:36:25 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-02-23 00:36:25 +0000
commite960a4e39b73eccabb3c8f5c3fc72c5e285d5351 (patch)
tree3444d30c0954ebd7b163d2bcb980f68e757b89bd /llvm/unittests/ExecutionEngine/Orc
parent9e07346679663cfa971ee1b6ed2ab6adcd919541 (diff)
downloadbcm5719-llvm-e960a4e39b73eccabb3c8f5c3fc72c5e285d5351.tar.gz
bcm5719-llvm-e960a4e39b73eccabb3c8f5c3fc72c5e285d5351.zip
[orc] Add a trivial unit test to get the ball rolling
I made my best guess at the Makefile, since I don't have a make build. I'm not sure if it should be valid to add an empty list of things, but it seemed the sort of degenerate case. llvm-svn: 230196
Diffstat (limited to 'llvm/unittests/ExecutionEngine/Orc')
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt8
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp30
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/Makefile16
3 files changed, 54 insertions, 0 deletions
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
+
OpenPOWER on IntegriCloud