diff options
Diffstat (limited to 'mlir/unittests/IR/SubElementInterfaceTest.cpp')
-rw-r--r-- | mlir/unittests/IR/SubElementInterfaceTest.cpp | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/mlir/unittests/IR/SubElementInterfaceTest.cpp b/mlir/unittests/IR/SubElementInterfaceTest.cpp deleted file mode 100644 index ab461f4dc340..000000000000 --- a/mlir/unittests/IR/SubElementInterfaceTest.cpp +++ /dev/null @@ -1,36 +0,0 @@ -//===- SubElementInterfaceTest.cpp - SubElementInterface 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/Builders.h" -#include "mlir/IR/BuiltinAttributes.h" -#include "mlir/IR/SubElementInterfaces.h" -#include "gtest/gtest.h" -#include <cstdint> - -using namespace mlir; -using namespace mlir::detail; - -namespace { -TEST(SubElementInterfaceTest, Nested) { - MLIRContext context; - Builder builder(&context); - - BoolAttr trueAttr = builder.getBoolAttr(true); - BoolAttr falseAttr = builder.getBoolAttr(false); - ArrayAttr boolArrayAttr = builder.getArrayAttr({trueAttr, falseAttr}); - StringAttr strAttr = builder.getStringAttr("array"); - DictionaryAttr dictAttr = - builder.getDictionaryAttr(builder.getNamedAttr(strAttr, boolArrayAttr)); - - SmallVector<Attribute> subAttrs; - dictAttr.walkSubAttrs([&](Attribute attr) { subAttrs.push_back(attr); }); - EXPECT_EQ(llvm::ArrayRef(subAttrs), - ArrayRef<Attribute>({strAttr, trueAttr, falseAttr, boolArrayAttr})); -} - -} // namespace |