summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp
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/LazyEmittingLayerTest.cpp
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/LazyEmittingLayerTest.cpp')
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp30
1 files changed, 30 insertions, 0 deletions
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);
+}
+
+}
OpenPOWER on IntegriCloud