Skip to content

Commit b6a56b8

Browse files
[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.
1 parent 3687815 commit b6a56b8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

llvm/test/tools/llvm-remarkutil/convert.test

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
RUN: llvm-remarkutil bitstream2yaml %p/Inputs/two-remarks.bitstream -o - | FileCheck %s -strict-whitespace
2-
RUN: llvm-remarkutil yaml2bitstream %p/Inputs/two-remarks.yaml -o %t
3-
RUN: llvm-remarkutil bitstream2yaml %t -o - | FileCheck %s -strict-whitespace
1+
RUN: llvm-remarkutil bitstream2yaml %p/Inputs/two-remarks.bitstream -o %t.yaml
2+
RUN: FileCheck %s -strict-whitespace < %t.yaml
3+
RUN: llvm-remarkutil yaml2bitstream %p/Inputs/two-remarks.yaml -o %t.bitstream
4+
RUN: llvm-remarkutil bitstream2yaml %t.bitstream -o - | FileCheck %s -strict-whitespace
45

56
; CHECK: --- !Analysis
67
; CHECK-NEXT: Pass: prologepilog

llvm/tools/llvm-remarkutil/RemarkConvert.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ static Error tryBitstream2YAML() {
133133
if (!E.isA<EndOfFileError>())
134134
return E;
135135
consumeError(std::move(E));
136+
OF->keep();
136137
return Error::success();
137138
}
138139
} // namespace bitstream2yaml

0 commit comments

Comments
 (0)