summaryrefslogtreecommitdiff
path: root/unittests/ADT/APIntTest.cpp
Commit message (Collapse)AuthorAge
* [APInt] Implement tcDecrement as a counterpart to tcIncrement. This is for ↵Michael Gottesman2013-05-28
| | | | | | | | use in APFloat IEEE-754R 2008 nextUp/nextDown function. rdar://13852078 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182801 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the SplatByte helper to APInt and generalize it a bit.Benjamin Kramer2013-02-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175621 91177308-0d34-0410-b5e6-96231b3b80d8
* ADT: Correct APInt::getActiveWords for zero valuesMeador Inge2013-02-07
| | | | | | | | | | PR15138 was opened because of a segfault in the Bitcode writer. The actual issue ended up being a bug in APInt where calls to APInt::getActiveWords returns a bogus value when the APInt value is 0. This patch fixes the problem by ensuring that getActiveWords returns 1 for 0 valued APInts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174641 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort the #include lines for unittest/...Chandler Carruth2012-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169250 91177308-0d34-0410-b5e6-96231b3b80d8
* fix the quotient returned by sdivrem() for the case when LHS is negative and ↵Nuno Lopes2012-05-22
| | | | | | | | RHS is positive based on a patch by Preston Briggs, with some modifications git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157231 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a unittest for rotating a really big APInt.Benjamin Kramer2012-02-07
| | | | | | Clang miscompiles it under certain circumstances, and it's a good exercise for APInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149986 91177308-0d34-0410-b5e6-96231b3b80d8
* Some unittests for APInt rotates; patch by Cameron McInally.Eli Friedman2011-12-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147186 91177308-0d34-0410-b5e6-96231b3b80d8
* APInt: update asserts for base-36Dylan Noblesmith2011-12-16
| | | | | | | | Hexatridecimal was added in r139695. And fix the unittest that now triggers the assert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146754 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix APInt::operator*= so that it computes the correct result for large ↵Eli Friedman2011-10-07
| | | | | | integers where there is unsigned overflow. Fix APFloat::toString so that it doesn't depend on the incorrect behavior in common cases (and computes the correct result in some rare cases). Fixes PR11086. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141441 91177308-0d34-0410-b5e6-96231b3b80d8
* Add APInt support for converting to/from hexatridecimal stringsDouglas Gregor2011-09-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139695 91177308-0d34-0410-b5e6-96231b3b80d8
* Add APInt(numBits, ArrayRef<uint64_t> bigVal) constructor to prevent future ↵Jeffrey Yasskin2011-07-18
| | | | | | | | | ambiguity errors like the one corrected by r135261. Migrate all LLVM callers of the old constructor to the new one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135431 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests: add test for APInt::toString()Dylan Noblesmith2011-06-15
| | | | | | | | Follow up to r133032. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133107 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an argument to APInt's magic udiv calculation to specify the number of ↵Benjamin Kramer2011-03-17
| | | | | | | | bits that are known zero in the divided number. This will come in handy soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127828 91177308-0d34-0410-b5e6-96231b3b80d8
* The signed version of our "magic number" computation for the integer ↵Cameron Zwarich2011-02-21
| | | | | | | | | | | | | approximation of a constant had a minor typo introduced when copying it from the book, which caused it to favor negative approximations over positive approximations in many cases. Positive approximations require fewer operations beyond the multiplication. In the case of division by 3, we still generate code that is a single instruction larger than GCC's code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126097 91177308-0d34-0410-b5e6-96231b3b80d8
* PR5207: Rename overloaded APInt methods set(), clear(), flip() toJay Foad2010-12-01
| | | | | | setAllBits(), setBit(unsigned), etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120564 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to unbreak the FreeBSD buildbot by XFAILing a unit test that seems to beJakob Stoklund Olesen2010-09-14
| | | | | | | | miscompiled by the system gcc-4.2.1 The test remains enabled for the second-stage test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113824 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch from EXPECT_EQ({true,false, ...) to the more canonicalChandler Carruth2010-07-13
| | | | | | | | EXPECT_{TRUE,FALSE}(...) macros. This also prevents suprious warnings about bool-to-pointer conversion that occurs withit EXPECT_EQ. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108248 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix death tests in -Asserts builds.Jeffrey Yasskin2010-03-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98701 91177308-0d34-0410-b5e6-96231b3b80d8
* Pacify the compiler (signed with unsigned comparison) by makingDuncan Sands2009-10-13
| | | | | | | these constants unsigned. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83962 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a ceilLogBase2 function to APInt.Dan Gohman2009-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83932 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a few more conversion warnings on 4.0Daniel Dunbar2009-09-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82232 91177308-0d34-0410-b5e6-96231b3b80d8
* Another try at fixing compile warnings on 4.0Daniel Dunbar2009-09-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82148 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to fix some 4.0.0 build warnings.Daniel Dunbar2009-09-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81752 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify, now that gtest supports raw_ostream directly.Daniel Dunbar2009-09-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81102 91177308-0d34-0410-b5e6-96231b3b80d8
* split raw_os_ostream out to its own header and implementation file. ThisChris Lattner2009-08-24
| | | | | | | | means that raw_ostream no longer has to #include <iosfwd>. Nothing in llvm should use raw_os_ostream.h, but llvm-gcc and some unit tests do. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79886 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak unit tests.Daniel Dunbar2009-08-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79879 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct for recent assert change.Bill Wendling2009-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79601 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug with APInt::getBitsNeeded with for base 10 numbers 0-9.Erick Tryzelaar2009-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79593 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow '+' to appear in APInt strings, and add more unit tests.Erick Tryzelaar2009-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79592 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap unit test death tests in GTEST_HAS_DEATH_TESTErick Tryzelaar2009-08-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79218 91177308-0d34-0410-b5e6-96231b3b80d8
* Add failure tests to APInt unit test.Erick Tryzelaar2009-08-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79209 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert APint::{fromString,APInt,getBitsNeeded} to use StringRef.Daniel Dunbar2009-08-13
| | | | | | | - Patch by Erick Tryzelaar, with some edits (and a bug fix) from me. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78885 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply 74494, this time removing the conflicting definition of operator<<Dan Gohman2009-06-30
| | | | | | | in APIntTest.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74550 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR4040: APInt's string constructor is too strictChris Lattner2009-04-25
| | | | | | | patch by Jeff Yasskin! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70058 91177308-0d34-0410-b5e6-96231b3b80d8
* * Fixed calls to APInt ctor to work for negative values on Darwin/x86Misha Brukman2009-04-08
| | | | | | | | * Converted C-style casts to C++-style casts git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68613 91177308-0d34-0410-b5e6-96231b3b80d8
* Converted a1.ll to unittests.Misha Brukman2009-03-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67652 91177308-0d34-0410-b5e6-96231b3b80d8
* Renamed unittest files to have a consistent {Tt}est suffix.Misha Brukman2009-03-19
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67326 91177308-0d34-0410-b5e6-96231b3b80d8