I got problem in BranchInst+SetCondInst

Hi all,

the small test modeling my problem is attached.
(see comments in file attached)

the problem is that both

    SetCondInst* CondInst
      = new SetCondInst( Instruction::SetLE, One, Two );


    SetCondInst* CondInst
      = new SetCondInst( Instruction::SetLE, Two, One );

have the same output...

Anyone have a sharper eye?..

condition.cpp (3.72 KB)


Looks to me like you forgot to put the SetCondInst into a basic block.
You should ALWAYS verify your module before emitting code. The verifier
would have caught this (instruction not in basic block). I suggest you
insert the verifier call into your program and see if your module
passes. If it does, let me know. If not, you'll know what the problem
is. See Stacker for an example use of the Verifier.