Skip to content

Commit 4d73991

Browse files
committed
Add a test
1 parent 8a5ef3f commit 4d73991

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mlir/test/mlir-tblgen/op-properties-predicates.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ def OpWithPredicates : NS_Op<"op_with_predicates"> {
7070
// CHECK-NEXT: if (!(((!prop.has_value())) || ((::llvm::all_of((*(prop)), [](const int64_t& baseStore) -> bool { return [](int64_t baseIface) -> bool { return ((baseIface >= 0)); }(baseStore); })) && (!(((*(prop)).empty()))))))
7171
// CHECK: failed to satisfy constraint: optional non-empty array of non-negative int64_
7272

73+
// CHECK-LABEL: ::llvm::LogicalResult OpWithPredicatesAdaptor::verify
74+
// Note: comprehensive emission of verifiers is tested in verifyINvariantsImpl() below
75+
// CHECK: int64_t tblgen_scalar = this->getScalar();
76+
// CHECK: if (!((tblgen_scalar >= 0)))
77+
// CHECK: return emitError(loc, "'test.op_with_predicates' op ""property 'scalar' failed to satisfy constraint: non-negative int64_t");
78+
7379
// CHECK-LABEL: OpWithPredicates::verifyInvariantsImpl()
7480
// Note: for test readability, we capture [[maybe_unused]] into the variable maybe_unused
7581
// CHECK: [[maybe_unused:\[\[maybe_unused\]\]]] int64_t tblgen_scalar = this->getScalar();

0 commit comments

Comments
 (0)