mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-18 02:16:43 +00:00
llvm-modextract: Call keep() on the output stream before exiting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288435 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c31c930cdf
commit
a11b564b77
@ -4,6 +4,11 @@
|
||||
; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck %s
|
||||
; RUN: not llvm-modextract -b -n 1 -o - %t 2>&1 | FileCheck --check-prefix=ERROR %s
|
||||
|
||||
; RUN: llvm-modextract -n 0 -o %t0 %t
|
||||
; RUN: llvm-dis -o - %t0 | FileCheck %s
|
||||
; RUN: llvm-modextract -b -n 0 -o %t1 %t
|
||||
; RUN: llvm-dis -o - %t1 | FileCheck %s
|
||||
|
||||
; CHECK: define void @f()
|
||||
; ERROR: llvm-modextract: error: module index out of range; bitcode file contains 1 module(s)
|
||||
|
||||
|
@ -62,11 +62,13 @@ int main(int argc, char **argv) {
|
||||
SmallVector<char, 0> Header;
|
||||
BitcodeWriter Writer(Header);
|
||||
Out->os() << Header << Ms[ModuleIndex].getBuffer();
|
||||
Out->keep();
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::unique_ptr<Module> M = ExitOnErr(Ms[ModuleIndex].parseModule(Context));
|
||||
WriteBitcodeToFile(M.get(), Out->os());
|
||||
|
||||
Out->keep();
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user