llvm/llvm/unittests/Transforms/Utils/CloningTest.cpp

//===- Cloning.cpp - Unit tests for the Cloner ----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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 that a new, distinct function was created.
TEST_F(CloneFunc, NewFunctionCreated) {}

// Test that a new subprogram entry was added and is pointing to the new
// function, while the original subprogram still points to the old one.
TEST_F(CloneFunc, Subprogram) {}

// Test that instructions in the old function still belong to it in the
// metadata, while instruction in the new function belong to the new one.
TEST_F(CloneFunc, InstructionOwnership) {}

// Test that the arguments for debug intrinsics in the new function were
// properly cloned
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) {}
} // namespace