llvm/llvm/unittests/SandboxIR/SandboxIRTest.cpp

//===- SandboxIRTest.cpp --------------------------------------------------===//
//
// 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/AsmParser/Parser.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Module.h"
#include "llvm/SandboxIR/BasicBlock.h"
#include "llvm/SandboxIR/Constant.h"
#include "llvm/SandboxIR/Function.h"
#include "llvm/SandboxIR/Instruction.h"
#include "llvm/SandboxIR/Module.h"
#include "llvm/SandboxIR/Utils.h"
#include "llvm/SandboxIR/Value.h"
#include "llvm/Support/SourceMgr.h"
#include "gmock/gmock-matchers.h"
#include "gtest/gtest.h"

usingnamespacellvm;

struct SandboxIRTest : public testing::Test {};

TEST_F(SandboxIRTest, ClassID) {}

TEST_F(SandboxIRTest, ConstantInt) {}

TEST_F(SandboxIRTest, ConstantFP) {}

// Tests ConstantArray, ConstantStruct and ConstantVector.
TEST_F(SandboxIRTest, ConstantAggregate) {}

TEST_F(SandboxIRTest, ConstantAggregateZero) {}

TEST_F(SandboxIRTest, ConstantPointerNull) {}

TEST_F(SandboxIRTest, PoisonValue) {}

TEST_F(SandboxIRTest, UndefValue) {}

TEST_F(SandboxIRTest, GlobalValue) {}

TEST_F(SandboxIRTest, GlobalObject) {}

TEST_F(SandboxIRTest, GlobalIFunc) {}

TEST_F(SandboxIRTest, GlobalVariable) {}

TEST_F(SandboxIRTest, GlobalAlias) {}

TEST_F(SandboxIRTest, NoCFIValue) {}

TEST_F(SandboxIRTest, ConstantPtrAuth) {}

TEST_F(SandboxIRTest, ConstantExpr) {}

TEST_F(SandboxIRTest, BlockAddress) {}

TEST_F(SandboxIRTest, DSOLocalEquivalent) {}

TEST_F(SandboxIRTest, ConstantTokenNone) {}

TEST_F(SandboxIRTest, Use) {}

TEST_F(SandboxIRTest, RUOW) {}

TEST_F(SandboxIRTest, RAUW_RUWIf) {}

// Check that the operands/users are counted correctly.
//  I1
// /  \
// \  /
//  I2
TEST_F(SandboxIRTest, DuplicateUses) {}

TEST_F(SandboxIRTest, Function) {}

TEST_F(SandboxIRTest, Module) {}

TEST_F(SandboxIRTest, BasicBlock) {}

TEST_F(SandboxIRTest, Instruction) {}

TEST_F(SandboxIRTest, VAArgInst) {}

TEST_F(SandboxIRTest, FreezeInst) {}

TEST_F(SandboxIRTest, FenceInst) {}

TEST_F(SandboxIRTest, SelectInst) {}

TEST_F(SandboxIRTest, ExtractElementInst) {}

TEST_F(SandboxIRTest, InsertElementInst) {}

TEST_F(SandboxIRTest, ShuffleVectorInst) {}

TEST_F(SandboxIRTest, ExtractValueInst) {}

TEST_F(SandboxIRTest, InsertValueInst) {}

TEST_F(SandboxIRTest, BranchInst) {}

TEST_F(SandboxIRTest, LoadInst) {}

TEST_F(SandboxIRTest, StoreInst) {}

TEST_F(SandboxIRTest, ReturnInst) {}

TEST_F(SandboxIRTest, CallBase) {}

TEST_F(SandboxIRTest, CallInst) {}

TEST_F(SandboxIRTest, InvokeInst) {}

TEST_F(SandboxIRTest, CallBrInst) {}

TEST_F(SandboxIRTest, LandingPadInst) {}

TEST_F(SandboxIRTest, FuncletPadInst_CatchPadInst_CleanupPadInst) {}

TEST_F(SandboxIRTest, CatchReturnInst) {}

TEST_F(SandboxIRTest, CleanupReturnInst) {}

TEST_F(SandboxIRTest, GetElementPtrInstruction) {}

TEST_F(SandboxIRTest, Flags) {}

TEST_F(SandboxIRTest, CatchSwitchInst) {}

TEST_F(SandboxIRTest, ResumeInst) {}

TEST_F(SandboxIRTest, SwitchInst) {}

TEST_F(SandboxIRTest, UnaryOperator) {}

TEST_F(SandboxIRTest, BinaryOperator) {}

TEST_F(SandboxIRTest, PossiblyDisjointInst) {}

TEST_F(SandboxIRTest, AtomicRMWInst) {}

TEST_F(SandboxIRTest, AtomicCmpXchgInst) {}

TEST_F(SandboxIRTest, AllocaInst) {}

TEST_F(SandboxIRTest, CastInst) {}

TEST_F(SandboxIRTest, PossiblyNonNegInst) {}

/// CastInst's subclasses are very similar so we can use a common test function
/// for them.
template <typename SubclassT, sandboxir::Instruction::Opcode OpcodeT>
void testCastInst(llvm::Module &M, llvm::Type *LLVMSrcTy,
                  llvm::Type *LLVMDstTy) {}

TEST_F(SandboxIRTest, TruncInst) {}

TEST_F(SandboxIRTest, ZExtInst) {}

TEST_F(SandboxIRTest, SExtInst) {}

TEST_F(SandboxIRTest, FPTruncInst) {}

TEST_F(SandboxIRTest, FPExtInst) {}

TEST_F(SandboxIRTest, UIToFPInst) {}

TEST_F(SandboxIRTest, SIToFPInst) {}

TEST_F(SandboxIRTest, FPToUIInst) {}

TEST_F(SandboxIRTest, FPToSIInst) {}

TEST_F(SandboxIRTest, IntToPtrInst) {}

TEST_F(SandboxIRTest, PtrToIntInst) {}

TEST_F(SandboxIRTest, BitCastInst) {}

TEST_F(SandboxIRTest, AddrSpaceCastInst) {}

TEST_F(SandboxIRTest, PHINode) {}

static void checkSwapOperands(sandboxir::Context &Ctx,
                              llvm::sandboxir::CmpInst *Cmp,
                              llvm::CmpInst *LLVMCmp) {}

static void checkCommonPredicates(sandboxir::CmpInst *Cmp,
                                  llvm::CmpInst *LLVMCmp) {}

TEST_F(SandboxIRTest, ICmpInst) {}

TEST_F(SandboxIRTest, FCmpInst) {}

TEST_F(SandboxIRTest, UnreachableInst) {}

/// Makes sure that all Instruction sub-classes have a classof().
TEST_F(SandboxIRTest, CheckClassof) {}