David Blaikie | e960a4e | 2015-02-23 00:36:25 +0000 | [diff] [blame] | 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; |
Lang Hames | 633fe14 | 2015-03-30 03:37:06 +0000 | [diff] [blame^] | 17 | ModuleSetHandleT addModuleSet( |
| 18 | std::list<std::unique_ptr<llvm::Module>>, |
| 19 | std::unique_ptr<llvm::RuntimeDyld::MemoryManager> MemMgr, |
| 20 | std::unique_ptr<llvm::RuntimeDyld::SymbolResolver> Resolver) { |
| 21 | EXPECT_FALSE(MemMgr); |
David Blaikie | e960a4e | 2015-02-23 00:36:25 +0000 | [diff] [blame] | 22 | return 42; |
| 23 | } |
| 24 | }; |
| 25 | |
| 26 | TEST(LazyEmittingLayerTest, Empty) { |
| 27 | MockBaseLayer M; |
| 28 | llvm::orc::LazyEmittingLayer<MockBaseLayer> L(M); |
Lang Hames | 633fe14 | 2015-03-30 03:37:06 +0000 | [diff] [blame^] | 29 | L.addModuleSet(std::list<std::unique_ptr<llvm::Module>>(), nullptr, nullptr); |
David Blaikie | e960a4e | 2015-02-23 00:36:25 +0000 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | } |