xref: /llvm-project/mlir/test/Dialect/SparseTensor/one_shot_bufferize_invalid.mlir (revision c43e6274577c72874253a42395bbd23a6fa148d9)
1// RUN: mlir-opt %s -one-shot-bufferize -verify-diagnostics
2
3#SparseVector = #sparse_tensor.encoding<{
4  map = (d0) -> (d0 : compressed)
5}>
6
7func.func @sparse_tensor_op(%arg0: tensor<64xf32, #SparseVector>) -> tensor<64xf32, #SparseVector> {
8  // expected-error @below{{sparse_tensor ops must be bufferized with the sparsifier}}
9  // expected-error @below{{failed to bufferize op}}
10  %0 = sparse_tensor.convert %arg0 : tensor<64xf32, #SparseVector> to tensor<64xf32, #SparseVector>
11  return %0 : tensor<64xf32, #SparseVector>
12}
13