mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-29 14:20:29 +00:00
Make sure the functions' range is empty before going through it in the LLVM C API test
llvm-svn: 260947
This commit is contained in:
parent
1c3ea77731
commit
a0396b8473
3
test/Bindings/llvm-c/empty.ll
Normal file
3
test/Bindings/llvm-c/empty.ll
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
; RUN: llvm-as < %s | llvm-dis > %t.orig
|
||||||
|
; RUN: llvm-as < %s | llvm-c-test --echo > %t.echo
|
||||||
|
; RUN: diff -w %t.orig %t.echo
|
@ -610,6 +610,11 @@ static void declare_function(LLVMValueRef Src, LLVMModuleRef M) {
|
|||||||
static void clone_functions(LLVMModuleRef Src, LLVMModuleRef Dst) {
|
static void clone_functions(LLVMModuleRef Src, LLVMModuleRef Dst) {
|
||||||
LLVMValueRef Begin = LLVMGetFirstFunction(Src);
|
LLVMValueRef Begin = LLVMGetFirstFunction(Src);
|
||||||
LLVMValueRef End = LLVMGetLastFunction(Src);
|
LLVMValueRef End = LLVMGetLastFunction(Src);
|
||||||
|
if (!Begin) {
|
||||||
|
if (End != nullptr)
|
||||||
|
report_fatal_error("Range has an end but no start");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// First pass, we declare all function
|
// First pass, we declare all function
|
||||||
LLVMValueRef Cur = Begin;
|
LLVMValueRef Cur = Begin;
|
||||||
|
Loading…
Reference in New Issue
Block a user