llvm/llvm/unittests/IR/ConstantsTest.cpp

//===- llvm/unittest/IR/ConstantsTest.cpp - Constants 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/IR/Constants.h"
#include "llvm-c/Core.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/IR/ConstantFold.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/SourceMgr.h"
#include "gtest/gtest.h"

namespace llvm {
namespace {

TEST(ConstantsTest, Integer_i1) {}

TEST(ConstantsTest, IntSigns) {}

TEST(ConstantsTest, PointerCast) {}

#define CHECK

TEST(ConstantsTest, AsInstructionsTest) {}

#ifdef GTEST_HAS_DEATH_TEST
#ifndef NDEBUG
TEST(ConstantsTest, ReplaceWithConstantTest) {
  LLVMContext Context;
  std::unique_ptr<Module> M(new Module("MyModule", Context));

  Type *Int32Ty = Type::getInt32Ty(Context);
  Constant *One = ConstantInt::get(Int32Ty, 1);

  Constant *Global =
      M->getOrInsertGlobal("dummy", PointerType::getUnqual(Int32Ty));
  Constant *GEP = ConstantExpr::getGetElementPtr(
      PointerType::getUnqual(Int32Ty), Global, One);
  EXPECT_DEATH(Global->replaceAllUsesWith(GEP),
               "this->replaceAllUsesWith\\(expr\\(this\\)\\) is NOT valid!");
}

#endif
#endif

#undef CHECK

TEST(ConstantsTest, ConstantArrayReplaceWithConstant) {}

TEST(ConstantsTest, ConstantExprReplaceWithConstant) {}

TEST(ConstantsTest, GEPReplaceWithConstant) {}

TEST(ConstantsTest, AliasCAPI) {}

static std::string getNameOfType(Type *T) {}

TEST(ConstantsTest, BuildConstantDataArrays) {}

TEST(ConstantsTest, BuildConstantDataVectors) {}

TEST(ConstantsTest, BitcastToGEP) {}

bool foldFuncPtrAndConstToNull(LLVMContext &Context, Module *TheModule,
                               uint64_t AndValue,
                               MaybeAlign FunctionAlign = std::nullopt) {}

TEST(ConstantsTest, FoldFunctionPtrAlignUnknownAnd2) {}

TEST(ConstantsTest, DontFoldFunctionPtrAlignUnknownAnd4) {}

TEST(ConstantsTest, FoldFunctionPtrAlign4) {}

TEST(ConstantsTest, DontFoldFunctionPtrAlign1) {}

TEST(ConstantsTest, FoldFunctionAlign4PtrAlignMultiple) {}

TEST(ConstantsTest, DontFoldFunctionAlign4PtrAlignIndependent) {}

TEST(ConstantsTest, DontFoldFunctionPtrIfNoModule) {}

TEST(ConstantsTest, FoldGlobalVariablePtr) {}

// Check that containsUndefOrPoisonElement and containsPoisonElement is working
// great

TEST(ConstantsTest, containsUndefElemTest) {}

// Check that poison elements in vector constants are matched
// correctly for both integer and floating-point types. Just don't
// crash on vectors of pointers (could be handled?).

TEST(ConstantsTest, isElementWiseEqual) {}

// Check that vector/aggregate constants correctly store undef and poison
// elements.

TEST(ConstantsTest, CheckElementWiseUndefPoison) {}

TEST(ConstantsTest, GetSplatValueRoundTrip) {}

TEST(ConstantsTest, ComdatUserTracking) {}

// Verify that the C API getters for BlockAddress work
TEST(ConstantsTest, BlockAddressCAPITest) {}

} // end anonymous namespace
} // end namespace llvm