<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>Code Extractor Issue</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>I'm having an issue with the CodeExtractor.  When I try to extract the lone basic block from the following function, I get an assertion error.<BR>
<BR>
<BR>
define i32 @test(i32 %x) {<BR>
        %tmp = call i32 @test3( i32 %x )                ; <i32> [#uses=1]<BR>
        ret i32 %tmp<BR>
}<BR>
<BR>
The assertion error is:<BR>
<BR>
lli: Dominators.cpp:71: void llvm::DominatorTree::splitBlock(llvm::BasicBlock*): Assertion `NewBB->getTerminator()->getNumSuccessors() == 1 && "NewBB should have a single successor!"' failed.<BR>
lli((anonymous namespace)::PrintStackTrace()+0x22)[0x87f7cb8]<BR>
lli((anonymous namespace)::SignalHandler(int)+0x110)[0x87f7f7c]<BR>
/lib/tls/libc.so.6[0x59fa48]<BR>
/lib/tls/libc.so.6(abort+0x129)[0x5a1319]<BR>
/lib/tls/libc.so.6(__assert_fail+0x101)[0x598f41]<BR>
lli(llvm::DominatorTree::splitBlock(llvm::BasicBlock*)+0xb7)[0x874edff]<BR>
lli[0x86b2672]<BR>
lli[0x86b2b15]<BR>
lli(llvm::ExtractCodeRegion(llvm::DominatorTree&, std::vector<llvm::BasicBlock*, std::allocator<llvm::BasicBlock*> > const&, bool)+0x39)[0x86b321d]<BR>
<BR>
I just updated to llvm-2.1 from llvm-1.9 where I was never having this problem.  I don't understand exactly what it's complaining about (maybe the fact that the terminator instruction is a 'ret' instruction?, but I don't see why it couldn't handle this kind of a block).<BR>
<BR>
Thanks,<BR>
Ben Mayne<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>