<div>Hi all:</div><div><span class="Apple-style-span" style="font-family: fixed-width, monospace; font-size: 12px; ">   I am trying to compare the return value of a call instruction with 0. The called function's return type is uint32. The return value is 1 or 0. But the icmp instruction cannot be created.</span></div>
<div><span class="Apple-style-span" style="font-family: fixed-width, monospace; font-size: 12px; "><br></span></div><div><span class="Apple-style-span" style="font-family: fixed-width, monospace; font-size: 12px; ">  CallInst *ret = CallInst::Create(ptr_func, params.begin(), params.end(), "", bb);</span></div>
<div><font class="Apple-style-span" face="fixed-width, monospace" size="3"><span class="Apple-style-span" style="font-size: 12px;">  Value *cmp = new ICmpInst(*bb, ICmpInst::ICMP_EQ, ret, ,ConstantInt::get(getIntegerType(32), 0) "")</span></font></div>
<div><span class="Apple-style-span" style="font-family: fixed-width, monospace; font-size: 12px; "><br></span></div><div><span class="Apple-style-span" style="font-family: fixed-width, monospace; font-size: 12px; ">The runtime error is:</span></div>
<meta http-equiv="content-type" content="text/html; charset=utf-8"><div>/usr/local/include/llvm/Instructions.h:690: llvm::ICmpInst::ICmpInst(llvm::BasicBlock&, llvm::CmpInst::Predicate, llvm::Value*, llvm::Value*, const llvm::Twine&): Assertion `getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to ICmp instruction are not of the same type!"' failed.</div>
<div>Aborted</div><div><br></div><div>I don't know how to use the return value of function .</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div><span class="Apple-style-span" style="font-family: fixed-width, monospace; font-size: 12px; ">Thanks for any input in advance. </span></div>
<div><br></div>