1 // RUN: mlir-opt -convert-memref-to-emitc %s -split-input-file -verify-diagnostics
3 func.func @memref_op(%arg0 : memref<2x4xf32>) {
4 // expected-error@+1 {{failed to legalize operation 'memref.copy'}}
5 memref.copy %arg0, %arg0 : memref<2x4xf32> to memref<2x4xf32>
11 func.func @alloca_with_dynamic_shape() {
13 // expected-error@+1 {{failed to legalize operation 'memref.alloca'}}
14 %1 = memref.alloca(%0) : memref<4x?xf32>
20 func.func @alloca_with_alignment() {
21 // expected-error@+1 {{failed to legalize operation 'memref.alloca'}}
22 %0 = memref.alloca() {alignment = 64 : i64}: memref<4xf32>
28 func.func @non_identity_layout() {
29 // expected-error@+1 {{failed to legalize operation 'memref.alloca'}}
30 %0 = memref.alloca() : memref<4x3xf32, affine_map<(d0, d1) -> (d1, d0)>>
36 func.func @zero_rank() {
37 // expected-error@+1 {{failed to legalize operation 'memref.alloca'}}
38 %0 = memref.alloca() : memref<f32>
44 func.func @zero_dim_rank_1() {
45 // expected-error@+1 {{failed to legalize operation 'memref.alloca'}}
46 %0 = memref.alloca() : memref<0xf32>
52 func.func @zero_dim_rank_3() {
53 // expected-error@+1 {{failed to legalize operation 'memref.alloca'}}
54 %0 = memref.alloca() : memref<2x0x4xf32>
60 // expected-error@+1 {{failed to legalize operation 'memref.global'}}
61 memref.global "nested" constant @nested_global : memref<3x7xf32>
65 func.func @unsupported_type_f128() {
66 // expected-error@+1 {{failed to legalize operation 'memref.alloca'}}
67 %0 = memref.alloca() : memref<4xf128>
73 func.func @unsupported_type_i4() {
74 // expected-error@+1 {{failed to legalize operation 'memref.alloca'}}
75 %0 = memref.alloca() : memref<4xi4>