llvm/llvm/unittests/CodeGen/GlobalISel/MachineIRBuilderTest.cpp

//===- MachineIRBuilderTest.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 "GISelMITest.h"
#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"

TEST_F(AArch64GISelMITest, TestBuildConstantFConstant) {}

#ifdef GTEST_HAS_DEATH_TEST
#ifndef NDEBUG

TEST_F(AArch64GISelMITest, TestBuildConstantFConstantDeath) {
  setUp();
  if (!TM)
    GTEST_SKIP();

  LLVMContext &Ctx = MF->getFunction().getContext();
  APInt APV32(32, 12345);

  // Test APInt version breaks
  EXPECT_DEATH(B.buildConstant(LLT::scalar(16), APV32),
               "creating constant with the wrong size");
  EXPECT_DEATH(B.buildConstant(LLT::fixed_vector(2, 16), APV32),
               "creating constant with the wrong size");

  // Test ConstantInt version breaks
  ConstantInt *CI = ConstantInt::get(Ctx, APV32);
  EXPECT_DEATH(B.buildConstant(LLT::scalar(16), *CI),
               "creating constant with the wrong size");
  EXPECT_DEATH(B.buildConstant(LLT::fixed_vector(2, 16), *CI),
               "creating constant with the wrong size");

  APFloat DoubleVal(APFloat::IEEEdouble());
  ConstantFP *CF = ConstantFP::get(Ctx, DoubleVal);
  EXPECT_DEATH(B.buildFConstant(LLT::scalar(16), *CF),
               "creating fconstant with the wrong size");
  EXPECT_DEATH(B.buildFConstant(LLT::fixed_vector(2, 16), *CF),
               "creating fconstant with the wrong size");
}

#endif
#endif

TEST_F(AArch64GISelMITest, DstOpSrcOp) {}

TEST_F(AArch64GISelMITest, BuildUnmerge) {}

TEST_F(AArch64GISelMITest, TestBuildFPInsts) {}

TEST_F(AArch64GISelMITest, BuildIntrinsic) {}

TEST_F(AArch64GISelMITest, BuildXor) {}

TEST_F(AArch64GISelMITest, BuildBitCounts) {}

TEST_F(AArch64GISelMITest, BuildCasts) {}

TEST_F(AArch64GISelMITest, BuildMinMaxAbs) {}

TEST_F(AArch64GISelMITest, BuildAtomicRMW) {}

TEST_F(AArch64GISelMITest, BuildMergeLikeInstr) {}

MachineIRBuilderDeathTest;

TEST_F(MachineIRBuilderDeathTest, BuildMergeValues) {}

TEST_F(AArch64GISelMITest, BuildAddoSubo) {}

TEST_F(AArch64GISelMITest, BuildBitfieldExtract) {}

TEST_F(AArch64GISelMITest, BuildFPEnv) {}

TEST_F(AArch64GISelMITest, BuildExtractSubvector) {}