llvm/mlir/unittests/IR/AttributeTest.cpp

//===- AttributeTest.cpp - Attribute 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 "mlir/IR/AsmState.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/BuiltinTypes.h"
#include "gtest/gtest.h"
#include <optional>

#include "../../test/lib/Dialect/Test/TestDialect.h"

usingnamespacemlir;
usingnamespacemlir::detail;

//===----------------------------------------------------------------------===//
// DenseElementsAttr
//===----------------------------------------------------------------------===//

template <typename EltTy>
static void testSplat(Type eltType, const EltTy &splatElt) {}

namespace {
TEST(DenseSplatTest, BoolSplat) {}
TEST(DenseSplatTest, BoolSplatRawRoundtrip) {}

TEST(DenseSplatTest, BoolSplatSmall) {}

TEST(DenseSplatTest, LargeBoolSplat) {}

TEST(DenseSplatTest, BoolNonSplat) {}

TEST(DenseSplatTest, OddIntSplat) {}

TEST(DenseSplatTest, Int32Splat) {}

TEST(DenseSplatTest, IntAttrSplat) {}

TEST(DenseSplatTest, F32Splat) {}

TEST(DenseSplatTest, F64Splat) {}

TEST(DenseSplatTest, FloatAttrSplat) {}

TEST(DenseSplatTest, BF16Splat) {}

TEST(DenseSplatTest, StringSplat) {}

TEST(DenseSplatTest, StringAttrSplat) {}

TEST(DenseComplexTest, ComplexFloatSplat) {}

TEST(DenseComplexTest, ComplexIntSplat) {}

TEST(DenseComplexTest, ComplexAPFloatSplat) {}

TEST(DenseComplexTest, ComplexAPIntSplat) {}

TEST(DenseScalarTest, ExtractZeroRankElement) {}

TEST(DenseSplatMapValuesTest, I32ToTrue) {}

TEST(DenseSplatMapValuesTest, I32ToFalse) {}
} // namespace

//===----------------------------------------------------------------------===//
// DenseResourceElementsAttr
//===----------------------------------------------------------------------===//

template <typename AttrT, typename T>
static void checkNativeAccess(MLIRContext *ctx, ArrayRef<T> data,
                              Type elementType) {}
template <typename AttrT, typename T>
static void checkNativeIntAccess(Builder &builder, size_t intWidth) {}

namespace {
TEST(DenseResourceElementsAttrTest, CheckNativeAccess) {}

TEST(DenseResourceElementsAttrTest, CheckNoCast) {}

TEST(DenseResourceElementsAttrTest, CheckNotMutableAllocateAndCopy) {}

TEST(DenseResourceElementsAttrTest, CheckInvalidData) {}

TEST(DenseResourceElementsAttrTest, CheckInvalidType) {}
} // namespace

//===----------------------------------------------------------------------===//
// SparseElementsAttr
//===----------------------------------------------------------------------===//

namespace {
TEST(SparseElementsAttrTest, GetZero) {}

//===----------------------------------------------------------------------===//
// SubElements
//===----------------------------------------------------------------------===//

TEST(SubElementTest, Nested) {}

// Test how many times we call copy-ctor when building an attribute.
TEST(CopyCountAttr, CopyCount) {}

// Test stripped printing using test dialect attribute.
TEST(CopyCountAttr, PrintStripped) {}

} // namespace