[Mlir-commits] [mlir] [mlir][memref]: Fix Bug in GlobalOp Verifier (PR #144900)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Wed Jun 25 07:56:35 PDT 2025
================
@@ -342,6 +342,16 @@ memref.global "priate" constant @memref5 : memref<2xf32> = uninitialized
// -----
+// expected-error @+1 {{op initial value element expected to be of type 'f16', but was of type 'f32'}}
+"memref.global"() <{constant, initial_value = dense<1.000000e+00> : tensor<1xf32>, sym_name = "memref6", sym_visibility = "private", type = memref<1xf16>}> : () -> ()
+
+// -----
+
+// expected-error @+1 {{op initial value shape expected to be 1, 2 but was 2, 2}}
+"memref.global"() <{constant, initial_value = dense<1.000000e+00> : tensor<2x2xf16>, sym_name = "memref7", sym_visibility = "private", type = memref<1x2xf16>}> : () -> ()
----------------
banach-space wrote:
This case is already tested here: https://github.com/llvm/llvm-project/blob/577199f9221ebc805a69372a2b19f4c8ebaf1daf/mlir/test/Dialect/MemRef/invalid.mlir#L318-L319
https://github.com/llvm/llvm-project/pull/144900
More information about the Mlir-commits
mailing list