llvm.org GIT mirror llvm / ab8b27b
Make sure the functions' range is empty before going through it in the LLVM C API test git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260947 91177308-0d34-0410-b5e6-96231b3b80d8 Amaury Sechet 4 years ago
2 changed file(s) with 8 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llvm-as < %s | llvm-dis > %t.orig
1 ; RUN: llvm-as < %s | llvm-c-test --echo > %t.echo
2 ; RUN: diff -w %t.orig %t.echo
609609 static void clone_functions(LLVMModuleRef Src, LLVMModuleRef Dst) {
610610 LLVMValueRef Begin = LLVMGetFirstFunction(Src);
611611 LLVMValueRef End = LLVMGetLastFunction(Src);
612 if (!Begin) {
613 if (End != nullptr)
614 report_fatal_error("Range has an end but no start");
615 return;
616 }
612617
613618 // First pass, we declare all function
614619 LLVMValueRef Cur = Begin;