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

Do not upgrade casts of bool to bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32404 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer 2006-12-09 19:40:41 +00:00
parent ed819df5ef
commit 7969681c8b

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