llvm.org GIT mirror llvm / ff84de7
'i8 full-range' sign extended to i16 should equal [-128, 128) not [-128, 127). Found by Daniel Dunbar and KLEE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75448 91177308-0d34-0410-b5e6-96231b3b80d8 Nick Lewycky 10 years ago
2 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
504504 assert(SrcTySize < DstTySize && "Not a value extension");
505505 if (isFullSet()) {
506506 return ConstantRange(APInt::getHighBitsSet(DstTySize,DstTySize-SrcTySize+1),
507 APInt::getLowBitsSet(DstTySize, SrcTySize-1));
507 APInt::getLowBitsSet(DstTySize, SrcTySize-1) + 1);
508508 }
509509
510510 APInt L = Lower; L.sext(DstTySize);
174174 ConstantRange SSome = Some.signExtend(20);
175175 ConstantRange SWrap = Wrap.signExtend(20);
176176 EXPECT_EQ(SFull, ConstantRange(APInt(20, INT16_MIN, true),
177 APInt(20, INT16_MAX, true)));
177 APInt(20, INT16_MAX + 1, true)));
178178 EXPECT_TRUE(SEmpty.isEmptySet());
179179 EXPECT_EQ(SOne, ConstantRange(APInt(One.getLower()).sext(20),
180180 APInt(One.getUpper()).sext(20)));