xref: /llvm-project/mlir/test/mlir-tblgen/type-constraints.td (revision a3d41879ecf5690a73f9226951d3856c7faa34a4)
1// RUN: mlir-tblgen -gen-type-constraint-decls -I %S/../../include %s | FileCheck %s --check-prefix=DECL
2// RUN: mlir-tblgen -gen-type-constraint-defs -I %S/../../include %s | FileCheck %s --check-prefix=DEF
3
4include "mlir/IR/CommonTypeConstraints.td"
5
6def DummyConstraint : AnyTypeOf<[AnyInteger, Index, AnyFloat]> {
7  let cppFunctionName = "isValidDummy";
8}
9
10// DECL: bool isValidDummy(::mlir::Type type);
11
12// DEF: bool isValidDummy(::mlir::Type type) {
13// DEF:   return (((::llvm::isa<::mlir::IntegerType>(type))) || ((::llvm::isa<::mlir::IndexType>(type))) || ((::llvm::isa<::mlir::FloatType>(type))));
14// DEF: }
15