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