aboutsummaryrefslogtreecommitdiffstats
path: root/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp
blob: a495766db91a07f2c2043789c4b3ff43e235aceb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//===- 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::RuntimeDyld::MemoryManager> MemMgr,
                  std::unique_ptr<llvm::RuntimeDyld::SymbolResolver> Resolver) {
    EXPECT_FALSE(MemMgr);
    return 42;
  }
};

TEST(LazyEmittingLayerTest, Empty) {
  MockBaseLayer M;
  llvm::orc::LazyEmittingLayer<MockBaseLayer> L(M);
  L.addModuleSet(std::list<std::unique_ptr<llvm::Module>>(), nullptr, nullptr);
}

}