Constant zero aggregate structures are imported to from llvm IR as undef. This includes for example LandingPad Instructions which have zero value filters, structs. This fixes the import to use the zeroOp to materialize a zero-initialized constant.
11 lines
400 B
LLVM
11 lines
400 B
LLVM
; RUN: mlir-translate --import-llvm %s | FileCheck %s
|
|
|
|
%Domain = type { ptr, ptr }
|
|
|
|
; CHECK: llvm.mlir.global external @D()
|
|
; CHECK-SAME: !llvm.struct<"Domain", (ptr, ptr)>
|
|
; CHECK: %[[E0:.+]] = llvm.mlir.zero : !llvm.ptr
|
|
; CHECK: %[[RES:.+]] = llvm.mlir.zero : !llvm.struct<"Domain", (ptr, ptr)>
|
|
; CHECK: llvm.return %[[RES]] : !llvm.struct<"Domain", (ptr, ptr)>
|
|
@D = global %Domain zeroinitializer
|