[Mlir-commits] [mlir] [MLIR][LLVMIR] Issue when importing LLVM modules which contain LandingPad Instructions (PR #171107)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Dec 8 03:43:59 PST 2025


================
@@ -274,3 +269,46 @@ define void @call_alias_func() {
 
 ; CHECK-LABEL: @call_alias_func()
 ; CHECK: llvm.dso_local_equivalent @alias_func : !llvm.ptr
+
+; // -----
+
+; Test that zeroinitializer for zero-element arrays is correctly translated
+; to llvm.mlir.zero instead of llvm.mlir.undef. This is a regression test for
+; a bug where empty aggregate constants were incorrectly converted to undef.
+
+ at global_zero_array = global [0 x ptr] zeroinitializer
+
+; CHECK: llvm.mlir.global external @global_zero_array() {addr_space = 0 : i32} : !llvm.array<0 x ptr> {
+; CHECK:   %[[ZERO:.+]] = llvm.mlir.zero : !llvm.array<0 x ptr>
+; CHECK:   llvm.return %[[ZERO]] : !llvm.array<0 x ptr>
+; CHECK: }
----------------
Men-cotton wrote:

We generally don't need to verify lines containing only closing braces or parentheses in the tests.
Please refer to the testing guide: https://mlir.llvm.org/getting_started/TestingGuide/#contributor-guidelines

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


More information about the Mlir-commits mailing list