[llvm] [cmake] Add possibility to use ChooseMSVCCRT.cmake when include LLVM library
[llvm-core.git] / unittests / ExecutionEngine / Orc / LazyEmittingLayerTest.cpp
blobcc67aa07b802a47147c1d6b7ebe833bf5c312768
1 //===- LazyEmittingLayerTest.cpp - Unit tests for the lazy emitting layer -===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "llvm/ExecutionEngine/Orc/LazyEmittingLayer.h"
10 #include "llvm/ExecutionEngine/RuntimeDyld.h"
11 #include "gtest/gtest.h"
13 namespace {
15 struct MockBaseLayer {
16 typedef int ModuleHandleT;
17 ModuleHandleT addModule(llvm::orc::VModuleKey,
18 std::shared_ptr<llvm::Module>) {
19 return 42;
23 TEST(LazyEmittingLayerTest, Empty) {
24 MockBaseLayer M;
25 llvm::orc::LazyEmittingLayer<MockBaseLayer> L(
26 llvm::AcknowledgeORCv1Deprecation, M);
27 cantFail(
28 L.addModule(llvm::orc::VModuleKey(), std::unique_ptr<llvm::Module>()));