aboutsummaryrefslogtreecommitdiffstats
path: root/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp
blob: b0ff1276c5cd8df7337167f55f250b9a92390b02 (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
//===- 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);
}

}