[llvm-commits] [llvm] r79615 - in /llvm/trunk/test/Analysis/Profiling: ./ 2009-08-21-irregular-loop.ll 2009-08-21-only-one-block.ll 2009-08-21-several-blocks.ll dg.exp


Andreas Neustifter wrote:
> Hi Daniel!
> Daniel Dunbar wrote:
>> Hi Andreas,
>> I talked with Chris about this the morning, and I think we agreed that
>> lli based tests for this stuff are ok, as long as we limit them to
>> just a few. The main thing we basically need lli for is to test the
>> generation of the profiling information; I think a single solid test
>> for that would be good enough for now.
> Yes, thats what I was thinking now. Its possbile to test much of the rest without actually executing it but there has to be one test that exercises the whole profiling tool chain in the intended way.

I have trouble implementing the tests now. It seems that llvm-prof uses std::cout for the regular text output and outs() for the printing of the annotated code. Problem is that this two streams interweave the output since they seem not to be syncronized.

How can I solve this? If I replace std::cout with outs() I get a whole bunch of error messages because the std::setw(3) are not usable with outs(). (This stuff is heavily used for output formating in llvm-prof.)

Besides that, how can I format the raw_outstreams anyways?


Hi Andy,

Please switch it to use outs() with llvm/Support/Format.h. This lets you do things like

   OS << format("%4.8f", myfloat) << " .. ";