#include "llvm/CodeGen/LowLevelTypeUtils.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Type.h"
#include "llvm/Support/TypeSize.h"
#include "gtest/gtest.h"
usingnamespacellvm;
namespace {
TEST(LowLevelTypeTest, Token) { … }
TEST(LowLevelTypeTest, Scalar) { … }
TEST(LowLevelTypeTest, Vector) { … }
TEST(LowLevelTypeTest, ScalarOrVector) { … }
TEST(LowLevelTypeTest, ChangeElementType) { … }
TEST(LowLevelTypeTest, ChangeNumElements) { … }
#ifdef GTEST_HAS_DEATH_TEST
#ifndef NDEBUG
TEST(LowLevelTypeTest, ChangeElementTypeDeath) {
const LLT P0 = LLT::pointer(0, 32);
const LLT V2P0 = LLT::fixed_vector(2, P0);
EXPECT_DEATH(P0.changeElementSize(64),
"invalid to directly change element size for pointers");
EXPECT_DEATH(V2P0.changeElementSize(64),
"invalid to directly change element size for pointers");
EXPECT_DEATH(P0.changeElementSize(32),
"invalid to directly change element size for pointers");
EXPECT_DEATH(V2P0.changeElementSize(32),
"invalid to directly change element size for pointers");
}
#endif
#endif
TEST(LowLevelTypeTest, Pointer) { … }
TEST(LowLevelTypeTest, Invalid) { … }
TEST(LowLevelTypeTest, Divide) { … }
TEST(LowLevelTypeTest, MultiplyElements) { … }
constexpr LLT CELLT = …;
constexpr LLT CES32 = …;
constexpr LLT CEV2S32 = …;
constexpr LLT CESV2S32 = …;
constexpr LLT CEP0 = …;
constexpr LLT CEV2P1 = …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
TEST(LowLevelTypeTest, ConstExpr) { … }
TEST(LowLevelTypeTest, IsFixedVector) { … }
TEST(LowLevelTypeTest, IsScalableVector) { … }
}