Fix test/Regression/Assembler/2006-12-09-Cast-To-Bool.ll

Do not upgrade casts of bool to bool.

llvm-svn: 32404
This commit is contained in:
Reid Spencer 2006-12-09 19:40:41 +00:00
parent 2fee8a99e2
commit 2126b0518e
1 changed files with 1 additions and 1 deletions

View File

@ -188,7 +188,7 @@ static std::string getCastUpgrade(
SrcTy.destroy();
SrcTy.newTy = new std::string("ulong");
SrcTy.oldTy = ULongTy;
} else if (DstTy.oldTy == BoolTy) {
} else if (DstTy.oldTy == BoolTy && SrcTy.oldTy != BoolTy) {
// cast ptr %x to bool was previously defined as setne ptr %x, null
// The ptrtoint semantic is to truncate, not compare so we must retain
// the original intent by replace the cast with a setne