In an assert build, the Error gets destroyed and we get "Program aborted
due to an unhandled Error:".
In release, we get an empty message.
llvm-svn: 350848
RUN: not llvm-objdump -t %s 2>&1 | FileCheck %s -check-prefix=UNKNOWN_FILE_TYPE
UNKNOWN_FILE_TYPE: '{{.*}}invalid-input.test': The file was not recognized as a valid object file
+
+RUN: not llvm-objdump -macho -disassemble -g -dsym=%s %p/Inputs/bind.macho-x86_64 2>&1 | FileCheck %s -check-prefix=UNKNOWN_FILE_TYPE_DSYM
+UNKNOWN_FILE_TYPE_DSYM: {{.*}}llvm-objdump: error:
Expected<std::unique_ptr<MachOObjectFile>> DbgObjCheck =
ObjectFile::createMachOObjectFile(BufOrErr.get()->getMemBufferRef());
- if (DbgObjCheck.takeError())
- report_error(MachOOF->getFileName(), DbgObjCheck.takeError());
+ if (Error E = DbgObjCheck.takeError())
+ report_error(MachOOF->getFileName(), std::move(E));
+
DbgObj = DbgObjCheck.get().release();
// We need to keep the file alive, because we're replacing DbgObj with it.
DSYMBuf = std::move(BufOrErr.get());