llvm/llvm/unittests/Transforms/Utils/CallPromotionUtilsTest.cpp

//===- CallPromotionUtilsTest.cpp - CallPromotionUtils unit tests ---------===//
//
// 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/CallPromotionUtils.h"
#include "llvm/Analysis/CtxProfAnalysis.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/NoFolder.h"
#include "llvm/IR/PassInstrumentation.h"
#include "llvm/ProfileData/PGOCtxProfReader.h"
#include "llvm/ProfileData/PGOCtxProfWriter.h"
#include "llvm/Support/JSON.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Testing/Support/SupportHelpers.h"
#include "gtest/gtest.h"

usingnamespacellvm;

static std::unique_ptr<Module> parseIR(LLVMContext &C, const char *IR) {}

// Returns a constant representing the vtable's address point specified by the
// offset.
static Constant *getVTableAddressPointOffset(GlobalVariable *VTable,
                                             uint32_t AddressPointOffset) {}

TEST(CallPromotionUtilsTest, TryPromoteCall) {}

TEST(CallPromotionUtilsTest, TryPromoteCall_NoFPLoad) {}

TEST(CallPromotionUtilsTest, TryPromoteCall_NoVTablePtrLoad) {}

TEST(CallPromotionUtilsTest, TryPromoteCall_NoVTableInitFound) {}

TEST(CallPromotionUtilsTest, TryPromoteCall_EmptyVTable) {}

TEST(CallPromotionUtilsTest, TryPromoteCall_NullFP) {}

// Based on clang/test/CodeGenCXX/member-function-pointer-calls.cpp
TEST(CallPromotionUtilsTest, TryPromoteCall_MemberFunctionCalls) {}

// Check that it isn't crashing due to missing promotion legality.
TEST(CallPromotionUtilsTest, TryPromoteCall_Legality) {}

TEST(CallPromotionUtilsTest, promoteCallWithVTableCmp) {}

TEST(CallPromotionUtilsTest, PromoteWithIcmpAndCtxProf) {}