diff --git a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td --- a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td +++ b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td @@ -42,7 +42,8 @@ // Base class for standard cast operations. Requires single operand and result, // but does not constrain them to specific types. class CastOp traits = []> : - Std_Op { + Std_Op { let results = (outs AnyType); diff --git a/mlir/test/Dialect/Standard/invalid.mlir b/mlir/test/Dialect/Standard/invalid.mlir --- a/mlir/test/Dialect/Standard/invalid.mlir +++ b/mlir/test/Dialect/Standard/invalid.mlir @@ -2,7 +2,7 @@ // CHECK-LABEL: test_index_cast_shape_error func @test_index_cast_shape_error(%arg0 : tensor) -> tensor<2xi64> { - // expected-error @+1 {{operand type 'tensor' and result type 'tensor<2xi64>' are cast incompatible}} + // expected-error @+1 {{requires the same shape for all operands and results}} %0 = index_cast %arg0 : tensor to tensor<2xi64> return %0 : tensor<2xi64> } @@ -11,7 +11,7 @@ // CHECK-LABEL: test_index_cast_tensor_error func @test_index_cast_tensor_error(%arg0 : tensor) -> i64 { - // expected-error @+1 {{operand type 'tensor' and result type 'i64' are cast incompatible}} + // expected-error @+1 {{requires the same shape for all operands and results}} %0 = index_cast %arg0 : tensor to i64 return %0 : i64 } diff --git a/mlir/test/IR/invalid-ops.mlir b/mlir/test/IR/invalid-ops.mlir --- a/mlir/test/IR/invalid-ops.mlir +++ b/mlir/test/IR/invalid-ops.mlir @@ -685,7 +685,7 @@ // ----- func @fpext_vec(%arg0 : vector<2xf16>) { - // expected-error@+1 {{are cast incompatible}} + // expected-error@+1 {{requires the same shape for all operands and results}} %0 = fpext %arg0 : vector<2xf16> to vector<3xf32> return } @@ -757,7 +757,7 @@ // ----- func @fptrunc_vec(%arg0 : vector<2xf16>) { - // expected-error@+1 {{are cast incompatible}} + // expected-error@+1 {{requires the same shape for all operands and results}} %0 = fptrunc %arg0 : vector<2xf16> to vector<3xf32> return }