[llvm-remarkutil] bitstream2yaml: Keep output file (#143220)

Keep the output file on successful exit, otherwise `llvm-remarkutil
bitstream2yaml -o filename.yaml ...` does not produce any output,
because the output file is deleted when the tool exits.
This commit is contained in:
Tobias Stadler
2025-06-12 15:50:31 +01:00
committed by GitHub
parent 3687815858
commit b6a56b8ef2
2 changed files with 5 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
RUN: llvm-remarkutil bitstream2yaml %p/Inputs/two-remarks.bitstream -o - | FileCheck %s -strict-whitespace
RUN: llvm-remarkutil yaml2bitstream %p/Inputs/two-remarks.yaml -o %t
RUN: llvm-remarkutil bitstream2yaml %t -o - | FileCheck %s -strict-whitespace
RUN: llvm-remarkutil bitstream2yaml %p/Inputs/two-remarks.bitstream -o %t.yaml
RUN: FileCheck %s -strict-whitespace < %t.yaml
RUN: llvm-remarkutil yaml2bitstream %p/Inputs/two-remarks.yaml -o %t.bitstream
RUN: llvm-remarkutil bitstream2yaml %t.bitstream -o - | FileCheck %s -strict-whitespace
; CHECK: --- !Analysis
; CHECK-NEXT: Pass: prologepilog

View File

@@ -133,6 +133,7 @@ static Error tryBitstream2YAML() {
if (!E.isA<EndOfFileError>())
return E;
consumeError(std::move(E));
OF->keep();
return Error::success();
}
} // namespace bitstream2yaml