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 "llvm/ExecutionEngine/RuntimeDyld.h" 12 #include "gtest/gtest.h" 13 14 namespace { 15 16 struct MockBaseLayer { 17 typedef int ModuleHandleT; addModule__anonf9636c390111::MockBaseLayer18 ModuleHandleT addModule(llvm::orc::VModuleKey, 19 std::shared_ptr<llvm::Module>) { 20 return 42; 21 } 22 }; 23 TEST(LazyEmittingLayerTest,Empty)24TEST(LazyEmittingLayerTest, Empty) { 25 MockBaseLayer M; 26 llvm::orc::LazyEmittingLayer<MockBaseLayer> L(M); 27 cantFail( 28 L.addModule(llvm::orc::VModuleKey(), std::unique_ptr<llvm::Module>())); 29 } 30 31 } 32