1 // RUN: mlir-opt -one-shot-bufferize="bufferize-function-boundaries" -split-input-file %s -verify-diagnostics
3 // expected-error @below{{failed to bufferize op}}
4 // expected-error @below{{incoming operands of block argument have inconsistent memory spaces}}
5 func.func @inconsistent_memory_space() -> tensor<5xf32> {
6 %0 = bufferization.alloc_tensor() {memory_space = 0 : ui64} : tensor<5xf32>
7 cf.br ^bb1(%0: tensor<5xf32>)
8 ^bb1(%arg1: tensor<5xf32>):
9 func.return %arg1 : tensor<5xf32>
11 %1 = bufferization.alloc_tensor() {memory_space = 1 : ui64} : tensor<5xf32>
12 cf.br ^bb1(%1: tensor<5xf32>)
17 // expected-error @below{{failed to bufferize op}}
18 // expected-error @below{{could not infer buffer type of block argument}}
19 func.func @cannot_infer_type() {
21 // The type of the block argument cannot be inferred.
22 ^bb1(%t: tensor<5xf32>):
23 cf.br ^bb1(%t: tensor<5xf32>)