diff --git a/flang/lib/Optimizer/CodeGen/CodeGen.cpp b/flang/lib/Optimizer/CodeGen/CodeGen.cpp --- a/flang/lib/Optimizer/CodeGen/CodeGen.cpp +++ b/flang/lib/Optimizer/CodeGen/CodeGen.cpp @@ -196,7 +196,8 @@ zero, ty, mlir::FloatAttr::get(zero.getType(), 0.0)); } else { // TODO: create ConstantAggregateZero for FIR aggregate/array types. - return zero.emitOpError( + return rewriter.notifyMatchFailure( + zero, "conversion of fir.zero with aggregate type not implemented yet"); } return success(); diff --git a/flang/test/Fir/convert-to-llvm-invalid.fir b/flang/test/Fir/convert-to-llvm-invalid.fir --- a/flang/test/Fir/convert-to-llvm-invalid.fir +++ b/flang/test/Fir/convert-to-llvm-invalid.fir @@ -3,7 +3,6 @@ // RUN: fir-opt --split-input-file --fir-to-llvm-ir --verify-diagnostics %s func @zero_aggregate() { - // expected-error@+2{{'fir.zero_bits' op conversion of fir.zero with aggregate type not implemented yet}} // expected-error@+1{{failed to legalize operation 'fir.zero_bits'}} %a = fir.zero_bits !fir.array<10xf32> return