xref: /aosp_15_r20/external/llvm/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker //===- LazyEmittingLayerTest.cpp - Unit tests for the lazy emitting layer -===//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker 
10*9880d681SAndroid Build Coastguard Worker #include "llvm/ExecutionEngine/Orc/LazyEmittingLayer.h"
11*9880d681SAndroid Build Coastguard Worker #include "gtest/gtest.h"
12*9880d681SAndroid Build Coastguard Worker 
13*9880d681SAndroid Build Coastguard Worker namespace {
14*9880d681SAndroid Build Coastguard Worker 
15*9880d681SAndroid Build Coastguard Worker struct MockBaseLayer {
16*9880d681SAndroid Build Coastguard Worker   typedef int ModuleSetHandleT;
addModuleSet__anon79c2d3ee0111::MockBaseLayer17*9880d681SAndroid Build Coastguard Worker   ModuleSetHandleT addModuleSet(
18*9880d681SAndroid Build Coastguard Worker                   std::list<std::unique_ptr<llvm::Module>>,
19*9880d681SAndroid Build Coastguard Worker                   std::unique_ptr<llvm::RuntimeDyld::MemoryManager> MemMgr,
20*9880d681SAndroid Build Coastguard Worker                   std::unique_ptr<llvm::RuntimeDyld::SymbolResolver> Resolver) {
21*9880d681SAndroid Build Coastguard Worker     EXPECT_FALSE(MemMgr);
22*9880d681SAndroid Build Coastguard Worker     return 42;
23*9880d681SAndroid Build Coastguard Worker   }
24*9880d681SAndroid Build Coastguard Worker };
25*9880d681SAndroid Build Coastguard Worker 
TEST(LazyEmittingLayerTest,Empty)26*9880d681SAndroid Build Coastguard Worker TEST(LazyEmittingLayerTest, Empty) {
27*9880d681SAndroid Build Coastguard Worker   MockBaseLayer M;
28*9880d681SAndroid Build Coastguard Worker   llvm::orc::LazyEmittingLayer<MockBaseLayer> L(M);
29*9880d681SAndroid Build Coastguard Worker   L.addModuleSet(std::list<std::unique_ptr<llvm::Module>>(), nullptr, nullptr);
30*9880d681SAndroid Build Coastguard Worker }
31*9880d681SAndroid Build Coastguard Worker 
32*9880d681SAndroid Build Coastguard Worker }
33