#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/DomTreeUpdater.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/DIBuilder.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Verifier.h"
#include "llvm/Support/SourceMgr.h"
#include "gtest/gtest.h"
usingnamespacellvm;
namespace {
class CloneInstruction : public ::testing::Test { … };
TEST_F(CloneInstruction, OverflowBits) { … }
TEST_F(CloneInstruction, Inbounds) { … }
TEST_F(CloneInstruction, Exact) { … }
TEST_F(CloneInstruction, Attributes) { … }
TEST_F(CloneInstruction, CallingConvention) { … }
TEST_F(CloneInstruction, DuplicateInstructionsToSplit) { … }
TEST_F(CloneInstruction, DuplicateInstructionsToSplitBlocksEq1) { … }
TEST_F(CloneInstruction, DuplicateInstructionsToSplitBlocksEq2) { … }
static void runWithLoopInfoAndDominatorTree(
Module &M, StringRef FuncName,
function_ref<void(Function &F, LoopInfo &LI, DominatorTree &DT)> Test) { … }
static std::unique_ptr<Module> parseIR(LLVMContext &C, const char *IR) { … }
TEST(CloneLoop, CloneLoopNest) { … }
class CloneFunc : public ::testing::Test { … };
TEST_F(CloneFunc, NewFunctionCreated) { … }
TEST_F(CloneFunc, Subprogram) { … }
TEST_F(CloneFunc, InstructionOwnership) { … }
TEST_F(CloneFunc, DebugIntrinsics) { … }
static int GetDICompileUnitCount(const Module& M) { … }
static bool haveCompileUnitsInCommon(const Module &LHS, const Module &RHS) { … }
TEST(CloneFunction, CloneEmptyFunction) { … }
TEST(CloneFunction, CloneFunctionWithInalloca) { … }
TEST(CloneFunction, CloneFunctionWithSubprograms) { … }
TEST(CloneFunction, CloneFunctionWithInlinedSubprograms) { … }
TEST(CloneFunction, CloneFunctionToDifferentModule) { … }
class CloneModule : public ::testing::Test { … };
TEST_F(CloneModule, Verify) { … }
TEST_F(CloneModule, OldModuleUnchanged) { … }
TEST_F(CloneModule, Subprogram) { … }
TEST_F(CloneModule, FunctionDeclarationMetadata) { … }
TEST_F(CloneModule, GlobalMetadata) { … }
TEST_F(CloneModule, GlobalDebugInfo) { … }
TEST_F(CloneModule, CompileUnit) { … }
TEST_F(CloneModule, Comdat) { … }
TEST_F(CloneModule, IFunc) { … }
TEST_F(CloneModule, CloneDbgLabel) { … }
}