1// RUN: mlir-opt %s -linalg-bufferize \
2// RUN: -arith-bufferize -tensor-bufferize -func-bufferize \
3// RUN: -finalizing-bufferize -buffer-deallocation \
4// RUN: -convert-linalg-to-loops -convert-scf-to-cf -convert-linalg-to-llvm --convert-memref-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts | \
5// RUN: mlir-cpu-runner -e main -entry-point-result=void \
6// RUN:   -shared-libs=%mlir_integration_test_dir/libmlir_runner_utils%shlibext \
7// RUN: | FileCheck %s
8
9func.func @main() {
10  %const = arith.constant dense<10.0> : tensor<2xf32>
11  %insert_val = arith.constant dense<20.0> : tensor<1xf32>
12  %inserted = tensor.insert_slice %insert_val into %const[0][1][1] : tensor<1xf32> into tensor<2xf32>
13
14  %unranked = tensor.cast %inserted : tensor<2xf32> to tensor<*xf32>
15  call @print_memref_f32(%unranked) : (tensor<*xf32>) -> ()
16
17  //      CHECK: Unranked Memref base@ = {{0x[-9a-f]*}}
18  // CHECK-SAME: rank = 1 offset = 0 sizes = [2] strides = [1] data =
19  // CHECK-NEXT: [20, 10]
20
21  return
22}
23
24func.func private @print_memref_f32(%ptr : tensor<*xf32>)
25