forked from OSchip/llvm-project
llvm-modextract: Call keep() on the output stream before exiting.
llvm-svn: 288435
This commit is contained in:
parent
e2ae41519f
commit
85c2184a8e
|
@ -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…
Reference in New Issue