@@ -35,39 +35,68 @@ def OpWithPredicates : NS_Op<"op_with_predicates"> {
35
35
);
36
36
}
37
37
38
+ // CHECK-LABEL: static ::llvm::LogicalResult __mlir_ods_local_prop_constraint_op2Dproperties2Dpredicates1
39
+ // CHECK-NEXT: int64_t prop
40
+ // CHECK-NEXT: if (!((prop >= 0)))
41
+ // CHECK: failed to satisfy constraint: non-negative int64_t
42
+
43
+ // CHECK-LABEL: static ::llvm::LogicalResult __mlir_ods_local_prop_constraint_op2Dproperties2Dpredicates2
44
+ // CHECK-NEXT: std::optional<int64_t> prop
45
+ // CHECK-NEXT: if (!(((!prop.has_value())) || (((*(prop)) >= 0))))
46
+ // CHECK: failed to satisfy constraint: optional non-negative int64_t
47
+
48
+ // CHECK-LABEL: static ::llvm::LogicalResult __mlir_ods_local_prop_constraint_op2Dproperties2Dpredicates3
49
+ // CHECK-NEXT: int64_t prop
50
+ // CHECK-NEXT: if (!(((prop >= 0)) && ((prop <= 5))))
51
+ // CHECK: failed to satisfy constraint: between 0 and 5
52
+
53
+ // CHECK-LABEL: static ::llvm::LogicalResult __mlir_ods_local_prop_constraint_op2Dproperties2Dpredicates4
54
+ // CHECK-NEXT: ::llvm::ArrayRef<int64_t> prop
55
+ // CHECK-NEXT: (!(::llvm::all_of(prop, [](const int64_t& baseStore) -> bool { return [](int64_t baseIface) -> bool { return ((baseIface >= 0)); }(baseStore); })))
56
+ // CHECK: failed to satisfy constraint: array of non-negative int64_t
57
+
58
+ // CHECK-LABEL: static ::llvm::LogicalResult __mlir_ods_local_prop_constraint_op2Dproperties2Dpredicates5
59
+ // CHECK-NEXT: ::llvm::ArrayRef<int64_t> prop
60
+ // CHECK-NEXT: if (!(!((prop.empty()))))
61
+ // CHECK: failed to satisfy constraint: non-empty array of int64_t
62
+
63
+ // CHECK-LABEL: static ::llvm::LogicalResult __mlir_ods_local_prop_constraint_op2Dproperties2Dpredicates6
64
+ // CHECK-NEXT: ::llvm::ArrayRef<int64_t> prop
65
+ // CHECX-NEXT: if (!((::llvm::all_of(prop, [](const int64_t& baseStore) -> bool { return [](int64_t baseIface) -> bool { return ((baseIface >= 0)); }(baseStore); })) && (!((prop.empty())))))
66
+ // CHECK: failed to satisfy constraint: non-empty array of non-negative int64_t
67
+
68
+ // CHECK-LABEL: static ::llvm::LogicalResult __mlir_ods_local_prop_constraint_op2Dproperties2Dpredicates7
69
+ // CHECK-NEXT: std::optional<::llvm::ArrayRef<int64_t>> prop
70
+ // 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()))))))
71
+ // CHECK: failed to satisfy constraint: optional non-empty array of non-negative int64_
72
+
38
73
// CHECK-LABEL: OpWithPredicates::verifyInvariantsImpl()
39
74
// Note: for test readability, we capture [[maybe_unused]] into the variable maybe_unused
40
75
// CHECK: [[maybe_unused:\[\[maybe_unused\]\]]] int64_t tblgen_scalar = this->getScalar();
41
- // CHECK: if (!(( tblgen_scalar >= 0 )))
42
- // CHECK-NEXT: return emitOpError("property 'scalar' failed to satisfy constraint: non-negative int64_t");
76
+ // CHECK: if (::mlir::failed(__mlir_ods_local_prop_constraint_op2Dproperties2Dpredicates1(*this, tblgen_scalar, "scalar" )))
77
+ // CHECK-NEXT: return ::mlir::failure()
43
78
44
79
// CHECK: [[maybe_unused]] std::optional<int64_t> tblgen_optional = this->getOptional();
45
- // CHECK: if (!(((!tblgen_optional.has_value())) || (((*(tblgen_optional)) >= 0))))
46
- // CHECK-NEXT: return emitOpError("property 'optional' failed to satisfy constraint: optional non-negative int64_t");
80
+ // CHECK: if (::mlir::failed(__mlir_ods_local_prop_constraint_op2Dproperties2Dpredicates2(*this, tblgen_optional, "optional")))
47
81
82
+ // COM: The predicates for "scalar" and "defaulted" are uniqued
48
83
// CHECK: [[maybe_unused]] int64_t tblgen_defaulted = this->getDefaulted();
49
- // CHECK: if (!((tblgen_defaulted >= 0)))
50
- // CHECK-NEXT: return emitOpError("property 'defaulted' failed to satisfy constraint: non-negative int64_t");
84
+ // CHECK: if (::mlir::failed(__mlir_ods_local_prop_constraint_op2Dproperties2Dpredicates1(*this, tblgen_defaulted, "defaulted")))
51
85
52
86
// CHECK: [[maybe_unused]] int64_t tblgen_moreConstrained = this->getMoreConstrained();
53
- // CHECK: if (!(((tblgen_moreConstrained >= 0)) && ((tblgen_moreConstrained <= 5))))
54
- // CHECK-NEXT: return emitOpError("property 'moreConstrained' failed to satisfy constraint: between 0 and 5");
87
+ // CHECK: if (::mlir::failed(__mlir_ods_local_prop_constraint_op2Dproperties2Dpredicates3(*this, tblgen_moreConstrained, "moreConstrained")))
55
88
56
89
// CHECK: [[maybe_unused]] ::llvm::ArrayRef<int64_t> tblgen_array = this->getArray();
57
- // CHECK: if (!(::llvm::all_of(tblgen_array, [](const int64_t& baseStore) -> bool { return [](int64_t baseIface) -> bool { return ((baseIface >= 0)); }(baseStore); })))
58
- // CHECK-NEXT: return emitOpError("property 'array' failed to satisfy constraint: array of non-negative int64_t");
90
+ // CHECK: if (::mlir::failed(__mlir_ods_local_prop_constraint_op2Dproperties2Dpredicates4(*this, tblgen_array, "array")))
59
91
60
92
// CHECK: [[maybe_unused]] ::llvm::ArrayRef<int64_t> tblgen_nonEmptyUnconstrained = this->getNonEmptyUnconstrained();
61
- // CHECK: if (!(!((tblgen_nonEmptyUnconstrained.empty()))))
62
- // CHECK-NEXT: return emitOpError("property 'non_empty_unconstrained' failed to satisfy constraint: non-empty array of int64_t");
93
+ // CHECK: if (::mlir::failed(__mlir_ods_local_prop_constraint_op2Dproperties2Dpredicates5(*this, tblgen_nonEmptyUnconstrained, "non_empty_unconstrained")))
63
94
64
95
// CHECK: [[maybe_unused]] ::llvm::ArrayRef<int64_t> tblgen_nonEmptyConstrained = this->getNonEmptyConstrained();
65
- // CHECK: if (!((::llvm::all_of(tblgen_nonEmptyConstrained, [](const int64_t& baseStore) -> bool { return [](int64_t baseIface) -> bool { return ((baseIface >= 0)); }(baseStore); })) && (!((tblgen_nonEmptyConstrained.empty())))))
66
- // CHECK-NEXT: return emitOpError("property 'non_empty_constrained' failed to satisfy constraint: non-empty array of non-negative int64_t");
96
+ // CHECK: if (::mlir::failed(__mlir_ods_local_prop_constraint_op2Dproperties2Dpredicates6(*this, tblgen_nonEmptyConstrained, "non_empty_constrained")))
67
97
68
98
// CHECK: [[maybe_unused]] std::optional<::llvm::ArrayRef<int64_t>> tblgen_nonEmptyOptional = this->getNonEmptyOptional();
69
- // CHECK: (!(((!tblgen_nonEmptyOptional.has_value())) || ((::llvm::all_of((*(tblgen_nonEmptyOptional)), [](const int64_t& baseStore) -> bool { return [](int64_t baseIface) -> bool { return ((baseIface >= 0)); }(baseStore); })) && (!(((*(tblgen_nonEmptyOptional)).empty()))))))
70
- // CHECK-NEXT: return emitOpError("property 'non_empty_optional' failed to satisfy constraint: optional non-empty array of non-negative int64_t");
99
+ // CHECK: if (::mlir::failed(__mlir_ods_local_prop_constraint_op2Dproperties2Dpredicates7(*this, tblgen_nonEmptyOptional, "non_empty_optional")))
71
100
72
101
// CHECK-NOT: int64_t tblgen_unconstrained
73
102
// CHECK: return ::mlir::success();
0 commit comments