brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · c201dda Raw
38 lines · plain
1// RUN: mlir-opt %s -split-input-file -verify-diagnostics2 3//===----------------------------------------------------------------------===//4// pdl_interp::CreateOperationOp5//===----------------------------------------------------------------------===//6 7pdl_interp.func @rewriter() {8  // expected-error@+1 {{op has inferred results, but the created operation 'foo.op' does not support result type inference}}9  %op = pdl_interp.create_operation "foo.op" -> <inferred>10  pdl_interp.finalize11}12 13// -----14 15pdl_interp.func @rewriter() {16  %type = pdl_interp.create_type i3217  // expected-error@+1 {{op with inferred results cannot also have explicit result types}}18  %op = "pdl_interp.create_operation"(%type) {19    inferredResultTypes,20    inputAttributeNames = [],21    name = "foo.op",22    operandSegmentSizes = array<i32: 0, 0, 1>23  } : (!pdl.type) -> (!pdl.operation)24  pdl_interp.finalize25}26 27// -----28 29//===----------------------------------------------------------------------===//30// pdl_interp::CreateRangeOp31//===----------------------------------------------------------------------===//32 33pdl_interp.func @rewriter(%value: !pdl.value, %type: !pdl.type) {34  // expected-error @below {{expected operand to have element type '!pdl.value', but got '!pdl.type'}}35  %range = pdl_interp.create_range %value, %type : !pdl.value, !pdl.type36  pdl_interp.finalize37}38