Lines Matching full:op
47 // Verify that `op` has the given set of result types, operands, and
54 Operation *op = concreteOp.getOperation(); in verifyOp() local
56 EXPECT_EQ(op->getNumResults(), resultTypes.size()); in verifyOp()
57 for (unsigned idx : llvm::seq(0U, op->getNumResults())) in verifyOp()
58 EXPECT_EQ(op->getResult(idx).getType(), resultTypes[idx]); in verifyOp()
60 EXPECT_EQ(op->getNumOperands(), operands.size()); in verifyOp()
61 for (unsigned idx : llvm::seq(0U, op->getNumOperands())) in verifyOp()
62 EXPECT_EQ(op->getOperand(idx), operands[idx]); in verifyOp()
64 EXPECT_EQ(op->getAttrs().size(), attrs.size()); in verifyOp()
66 EXPECT_EQ(op->getAttr(attrs[idx].getName().strref()), in verifyOp()
78 Operation *op = concreteOp.getOperation(); in verifyOp() local
80 EXPECT_EQ(op->getNumResults(), resultTypes.size()); in verifyOp()
81 for (unsigned idx : llvm::seq(0U, op->getNumResults())) in verifyOp()
82 EXPECT_EQ(op->getResult(idx).getType(), resultTypes[idx]); in verifyOp()
85 EXPECT_EQ(op->getNumOperands(), operands.size()); in verifyOp()
86 for (unsigned idx : llvm::seq(0U, op->getNumOperands())) in verifyOp()
87 EXPECT_EQ(op->getOperand(idx), operands[idx]); in verifyOp()
89 EXPECT_EQ(op->getAttrs().size(), attrs.size()); in verifyOp()
90 if (op->getAttrs().size() != attrs.size()) { in verifyOp()
92 llvm::errs() << "Op attrs:\n"; in verifyOp()
93 for (auto it : op->getAttrs()) in verifyOp()
101 EXPECT_EQ(op->getAttr(attrs[idx].getName().strref()), in verifyOp()
126 auto op = builder.create<test::TableGenBuildOp0>(loc, i32Ty, *cstI32); in TEST_F() local
127 verifyOp(op, {i32Ty}, {*cstI32}, noAttrs); in TEST_F()
130 op = builder.create<test::TableGenBuildOp0>(loc, TypeRange{i32Ty}, *cstI32); in TEST_F()
131 verifyOp(op, {i32Ty}, {*cstI32}, noAttrs); in TEST_F()
134 op = builder.create<test::TableGenBuildOp0>(loc, TypeRange{i32Ty}, in TEST_F()
136 verifyOp(op, {i32Ty}, {*cstI32}, noAttrs); in TEST_F()
139 op = builder.create<test::TableGenBuildOp0>(loc, TypeRange{i32Ty}, in TEST_F()
141 verifyOp(op, {i32Ty}, {*cstI32}, attrs); in TEST_F()
153 /// Test build methods for an Op with a single varadic arg and a single
156 // Test collective args, collective results method, building a unary op. in TEST_F()
157 auto op = builder.create<test::TableGenBuildOp1>(loc, TypeRange{i32Ty}, in TEST_F() local
159 verifyOp(op, {i32Ty}, {*cstI32}, noAttrs); in TEST_F()
161 // Test collective args, collective results method, building a unary op with in TEST_F()
163 op = builder.create<test::TableGenBuildOp1>(loc, TypeRange{i32Ty}, in TEST_F()
165 verifyOp(op, {i32Ty}, {*cstI32}, attrs); in TEST_F()
167 // Test collective args, collective results method, building a binary op. in TEST_F()
168 op = builder.create<test::TableGenBuildOp1>(loc, TypeRange{i32Ty, f32Ty}, in TEST_F()
170 verifyOp(op, {i32Ty, f32Ty}, {*cstI32, *cstF32}, noAttrs); in TEST_F()
172 // Test collective args, collective results method, building a binary op with in TEST_F()
174 op = builder.create<test::TableGenBuildOp1>( in TEST_F()
176 verifyOp(op, {i32Ty, f32Ty}, {*cstI32, *cstF32}, attrs); in TEST_F()
179 /// Test build methods for an Op with a single varadic arg and a non-variadic
183 auto op = in TEST_F() local
185 verifyOp(op, {i32Ty}, {*cstI32}, noAttrs); in TEST_F()
188 op = builder.create<test::TableGenBuildOp1>(loc, TypeRange{i32Ty}, in TEST_F()
190 verifyOp(op, {i32Ty}, {*cstI32}, noAttrs); in TEST_F()
193 op = builder.create<test::TableGenBuildOp1>(loc, TypeRange{i32Ty}, in TEST_F()
195 verifyOp(op, {i32Ty}, {*cstI32, *cstF32}, noAttrs); in TEST_F()
198 op = builder.create<test::TableGenBuildOp1>( in TEST_F()
200 verifyOp(op, {i32Ty}, {*cstI32, *cstF32}, attrs); in TEST_F()
203 /// Test build methods for an Op with a single varadic arg and multiple variadic
208 auto op = builder.create<test::TableGenBuildOp3>( in TEST_F() local
210 verifyOp(op, {i32Ty, f32Ty}, {*cstI32}, noAttrs); in TEST_F()
213 op = builder.create<test::TableGenBuildOp3>(loc, TypeRange{i32Ty, f32Ty}, in TEST_F()
215 verifyOp(op, {i32Ty, f32Ty}, {*cstI32}, noAttrs); in TEST_F()
218 op = builder.create<test::TableGenBuildOp3>(loc, TypeRange{i32Ty, f32Ty}, in TEST_F()
220 verifyOp(op, {i32Ty, f32Ty}, {*cstI32}, attrs); in TEST_F()
230 auto op = builder.create<test::TableGenBuildOp4>( in TEST_F() local
232 verifyOp(std::move(op), {i32Ty}, {*cstI32, *cstI32}, noAttrs); in TEST_F()
235 op = builder.create<test::TableGenBuildOp4>(loc, TypeRange{i32Ty}, in TEST_F()
237 verifyOp(std::move(op), {i32Ty}, {*cstI32, *cstI32}, noAttrs); in TEST_F()
240 op = in TEST_F()
242 verifyOp(std::move(op), {i32Ty}, {*cstI32, *cstI32}, noAttrs); in TEST_F()
245 op = builder.create<test::TableGenBuildOp4>(loc, ValueRange{*cstI32, *cstI32}, in TEST_F()
247 verifyOp(std::move(op), {i32Ty}, {*cstI32, *cstI32}, attrs); in TEST_F()
251 auto op = builder.create<test::TableGenBuildOp5>( in TEST_F() local
253 ASSERT_EQ(op->getNumRegions(), 1u); in TEST_F()
254 verifyOp(op, {i32Ty}, {*cstI32, *cstF32}, noAttrs); in TEST_F()
269 auto op = builder.create<test::TableGenBuildOp6>( in TEST_F() local
271 verifyOp(std::move(op), {f32Ty}, {*cstI32}, {*cstI32}, noAttrs); in TEST_F()
274 op = builder.create<test::TableGenBuildOp6>(loc, ValueRange{*cstI32}, in TEST_F()
276 verifyOp(std::move(op), {f32Ty}, {*cstI32}, {*cstI32}, noAttrs); in TEST_F()
279 op = builder.create<test::TableGenBuildOp6>( in TEST_F()
281 verifyOp(std::move(op), {f32Ty}, {*cstI32}, {*cstI32}, noAttrs); in TEST_F()
284 op = builder.create<test::TableGenBuildOp6>( in TEST_F()
286 verifyOp(std::move(op), {f32Ty}, {*cstI32}, {*cstI32}, attrs); in TEST_F()
289 op = builder.create<test::TableGenBuildOp6>(loc, ValueRange{*cstI32, *cstI32}, in TEST_F()
291 verifyOp(std::move(op), {f32Ty}, {*cstI32}, {*cstI32}, attrs); in TEST_F()