[Mlir-commits] [mlir] [mlir][memref]: Fix Bug in GlobalOp Verifier (PR #144900)

Andrzej WarzyƄski llvmlistbot at llvm.org
Wed Jun 25 11:27:37 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>}> : () -> ()
+
----------------
banach-space wrote:

OK, thanks for checking. Clearly the attribute is initialised differently in both cases. Since your code only affects the verbose format, the test coverage seems both sufficient and appropriate. 

https://github.com/llvm/llvm-project/pull/144900


More information about the Mlir-commits mailing list