[orc] Add a trivial unit test to get the ball rolling
[oota-llvm.git] / unittests / ExecutionEngine / Orc / LazyEmittingLayerTest.cpp
1 //===- LazyEmittingLayerTest.cpp - Unit tests for the lazy emitting layer -===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "llvm/ExecutionEngine/Orc/LazyEmittingLayer.h"
11 #include "gtest/gtest.h"
12
13 namespace {
14
15 struct MockBaseLayer {
16   typedef int ModuleSetHandleT;
17   ModuleSetHandleT addModuleSet(std::list<std::unique_ptr<llvm::Module>>,
18                                 std::unique_ptr<llvm::RTDyldMemoryManager> x) {
19     EXPECT_FALSE(x);
20     return 42;
21   }
22 };
23
24 TEST(LazyEmittingLayerTest, Empty) {
25   MockBaseLayer M;
26   llvm::orc::LazyEmittingLayer<MockBaseLayer> L(M);
27   L.addModuleSet(std::list<std::unique_ptr<llvm::Module>>(), nullptr);
28 }
29
30 }