summaryrefslogtreecommitdiff
path: root/unittests/ADT
Commit message (Collapse)AuthorAge
* [APFloat] Rename isIEEENormal => isNormal and remove old isNormal method.Michael Gottesman2013-06-20
| | | | | | | | The old isNormal is already functionally replaced by the method isFiniteNonZero in r184350 and all references to said method were replaced in LLVM/clang in r184356/134366. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184449 91177308-0d34-0410-b5e6-96231b3b80d8
* [APFloat] Fix typo in test so we actually test if we handle denormals.Michael Gottesman2013-06-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184447 91177308-0d34-0410-b5e6-96231b3b80d8
* [APFloat] Changed APFloat::isNormal => APFloat::isFiniteNonZero for all ↵Michael Gottesman2013-06-19
| | | | | | | | tests in unittests. I forgot to to do this in r184356. The only references were in APFloatTest.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184366 91177308-0d34-0410-b5e6-96231b3b80d8
* [APFloat] Added isFiniteNonZero predicate.Michael Gottesman2013-06-19
| | | | | | | | | | | | | | | | | This is the first patch in a series of patches to rename isNormal => isFiniteNonZero and isIEEENormal => isNormal. In order to prevent careless errors on my part the overall plan is: 1. Add the isFiniteNonZero predicate with tests. I can do this in a method independent of isNormal. (This step is this patch). 2. Convert all references to isNormal with isFiniteNonZero. My plan is to comment out isNormal locally and continually convert isNormal references => isFiniteNonZero until llvm/clang compiles. 3. Remove old isNormal and rename isIEEENormal to isNormal. 4. Look through all of said references from patch 2 and see if we can simplify them by using the new isNormal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184350 91177308-0d34-0410-b5e6-96231b3b80d8
* BitVector: Do the right thing in all() when Size is a multiple of BITWORD_SIZE.Benjamin Kramer2013-06-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183525 91177308-0d34-0410-b5e6-96231b3b80d8
* Optimize BitVector::all().Benjamin Kramer2013-06-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183521 91177308-0d34-0410-b5e6-96231b3b80d8
* IEEE-754R 5.7.2 General Operations is* operations (except for isCanonical).Michael Gottesman2013-06-04
| | | | | | | | | | | | | | | Specifically the following work was done: 1. If the operation was not implemented, I implemented it. 2. If the operation was already implemented, I just moved its location in the APFloat header into the IEEE-754R 5.7.2 section. If the name was incorrect, I put in a comment giving the true IEEE-754R name. Also unittests have been added for all of the functions which did not already have a unittest. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183179 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to avoid "integer literal too big" warnings from older GCCs.Benjamin Kramer2013-06-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183081 91177308-0d34-0410-b5e6-96231b3b80d8
* [APFloat] Added a unittest for APFloat::getZero.Michael Gottesman2013-05-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183028 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement IEEE-754R 2008 nextUp/nextDown functions in the guise of the ↵Michael Gottesman2013-05-30
| | | | | | | | function APFloat::next(bool nextDown). rdar://13852078 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182945 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a unittest for APFloat::getSmallestNormalized.Michael Gottesman2013-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182897 91177308-0d34-0410-b5e6-96231b3b80d8
* Added code to the unittest for APFloat::getSmallest to double check that we ↵Michael Gottesman2013-05-30
| | | | | | | | | consider the result to be denormal. I additionally changed certain checks to use EXPECT_FALSE instead of a boolean complement with EXPECT_TRUE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182896 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a unittest for APFloat::getSmallest.Michael Gottesman2013-05-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182894 91177308-0d34-0410-b5e6-96231b3b80d8
* [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
* Fix a bug that APFloat::fusedMultiplyAdd() mistakenly evaluate "14.5f * ↵Shuxin Yang2013-05-13
| | | | | | -14.5f + 225.0f" to 225.0f. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181715 91177308-0d34-0410-b5e6-96231b3b80d8
* SmallVector and SmallPtrSet allocations now power-of-two aligned.Jean-Luc Duprat2013-03-29
| | | | | | | | This time tested on both OSX and Linux. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178377 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Fix allocations of SmallVector and SmallPtrSet so they are more ↵Rafael Espindola2013-03-29
| | | | | | | | | | | | | | | | | prone to" This reverts commit 617330909f0c26a3f2ab8601a029b9bdca48aa61. It broke the bots: /home/clangbuild2/clang-ppc64-2/llvm.src/unittests/ADT/SmallVectorTest.cpp:150: PushPopTest /home/clangbuild2/clang-ppc64-2/llvm.src/unittests/ADT/SmallVectorTest.cpp:118: Failure Value of: v[i].getValue() Actual: 0 Expected: value Which is: 2 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178334 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix allocations of SmallVector and SmallPtrSet so they are more prone toJean-Luc Duprat2013-03-29
| | | | | | | | being power-of-two sized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178332 91177308-0d34-0410-b5e6-96231b3b80d8
* Only include move-related Optional<T> tests when rvalue references are ↵David Blaikie2013-02-21
| | | | | | available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175730 91177308-0d34-0410-b5e6-96231b3b80d8
* Add move ctor/assignment to Optional<T>David Blaikie2013-02-21
| | | | | | Code review feedback for r175580 by Jordan Rose. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175729 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
* Rename llvm::Optional<T>::Reset to 'reset' as per LLVM naming conventions.David Blaikie2013-02-20
| | | | | | Code review feedback on r175580 from Jordan Rose. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175595 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow llvm::Optional to work with types without default constructors.David Blaikie2013-02-20
| | | | | | | | | This generalizes Optional to require less from the T type by using aligned storage for backing & placement new/deleting the T into it when necessary. Also includes unit tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175580 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove my bogus MapVector::erase() with a narrower ::pop_back(), and add a ↵Douglas Gregor2013-02-19
| | | | | | unit test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175538 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
* Added a unit test for r173983 that verifies that Target.isiOS() works correctly.Michael Gottesman2013-01-30
| | | | | | | As a bonus I put in some extra checks to make sure that we are identifying the machine word of various Mac OS X/iOS targets appropriately. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173994 91177308-0d34-0410-b5e6-96231b3b80d8
* Add file to CMakeLists (file added in r173505)Dmitri Gribenko2013-01-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173513 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an insert() method to MapVector. Adds the first MapVector unit test.Nick Lewycky2013-01-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173505 91177308-0d34-0410-b5e6-96231b3b80d8
* APFloat: Make sure that we get a well-formed x87 NaN when converting from a ↵Benjamin Kramer2013-01-25
| | | | | | | | smaller type. Fixes PR15054. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173459 91177308-0d34-0410-b5e6-96231b3b80d8
* ADT/SparseMultiSetTest.cpp: Try to appease cygwin-clang on stage2, take two. ↵NAKAMURA Takumi2013-01-22
| | | | | | [-Wsign-compare] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173144 91177308-0d34-0410-b5e6-96231b3b80d8
* ADT/SparseMultiSetTest.cpp: Try to appease cygwin-clang (libstdc++-4.5) on ↵NAKAMURA Takumi2013-01-22
| | | | | | stage2. [-Wsign-compare] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173127 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new data structure, the SparseMultiSet, and changes to the MI ↵Michael Ilseman2013-01-21
| | | | | | | | | | scheduler to use it. A SparseMultiSet adds multiset behavior to SparseSet, while retaining SparseSet's desirable properties. Essentially, SparseMultiSet provides multiset behavior by storing its dense data in doubly linked lists that are inlined into the dense vector. This allows it to provide good data locality as well as vector-like constant-time clear() and fast constant time find(), insert(), and erase(). It also allows SparseMultiSet to have a builtin recycler rather than keeping SparseSet's behavior of always swapping upon removal, which allows it to preserve more iterators. It's often a better alternative to a SparseSet of a growable container or vector-of-vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173064 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement APFloat::isDenormal()Shuxin Yang2013-01-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171764 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an iplist::clearAndLeakNodesUnsafely() function.Jakob Stoklund Olesen2013-01-04
| | | | | | | | | | | | The iplist::clear() function can be quite expensive because it traverses the entire list, calling deleteNode() and removeNodeFromList() on each element. If node destruction and deallocation can be handled some other way, clearAndLeakNodesUnsafely() can be used to jettison all nodes without bringing them into cache. The function name is meant to be ominous. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171540 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort a few more #include lines in tools/... unittests/... and utils/...Chandler Carruth2013-01-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171363 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an assertion for a likely ilist::splice() contract violation.Jakob Stoklund Olesen2012-12-18
| | | | | | | | | | | | | | | | | | | | | | | The single-element ilist::splice() function supports a noop move: List.splice(I, List, I); The corresponding std::list function doesn't allow that, so add a unit test to document that behavior. This also means that List.splice(I, List, F); is somewhat surprisingly not equivalent to List.splice(I, List, F, next(F)); This patch adds an assertion to catch the illegal case I == F above. Alternatively, we could make I == F a legal noop, but that would make ilist differ even more from std::list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170443 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
* Switch LLVM_USE_RVALUE_REFERENCES to LLVM_HAS_RVALUE_REFERENCES.Chandler Carruth2012-11-30
| | | | | | | | | | | | | | Rationale: 1) This was the name in the comment block. ;] 2) It matches Clang's __has_feature naming convention. 3) It matches other compiler-feature-test conventions. Sorry for the noise. =] I've also switch the comment block to use a \brief tag and not duplicate the name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168996 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop the limitation to IEEE floating point types from the fdiv of pow2 -> ↵Benjamin Kramer2012-11-08
| | | | | | | | fmul transform. This is safe for x87 long doubles and ppc double doubles too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167582 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement arithmetic on APFloat with PPCDoubleDouble semantics byUlrich Weigand2012-10-29
| | | | | | | | | | | | | treating it as if it were an IEEE floating-point type with 106-bit mantissa. This makes compile-time arithmetic on "long double" for PowerPC in clang (in particular parsing of floating point constants) work, and fixes all "long double" related failures in the test suite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166951 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed bug in SmallDenseMap where it wouldn't leave enough space for an empty ↵Pete Cooper2012-10-23
| | | | | | bucket if the number of values was exactly equal to the small capacity. This led to an infinite loop when finding a non-existent element git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166492 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in the set(I,E)/reset(I,E) methods that I recently added. The ↵Owen Anderson2012-10-16
| | | | | | boundary condition for checking if I and E were in the same word were incorrect, and, beyond that, the mask computation was not using a wide enough constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166015 91177308-0d34-0410-b5e6-96231b3b80d8
* Add range-based set()/reset() to BitVector. These allow fast ↵Owen Anderson2012-10-15
| | | | | | setting/resetting of ranges of bits, particularly useful when dealing with very large BitVector's. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165984 91177308-0d34-0410-b5e6-96231b3b80d8
* Update CMake build.Benjamin Kramer2012-10-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165908 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo that made ImmutableMap::getMaxElement() useless.Benjamin Kramer2012-10-14
| | | | | | Add a basic unit test for ImmutableMap. Found by inspection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165907 91177308-0d34-0410-b5e6-96231b3b80d8
* Add powerpc-ibm-aix to Triple. Patch by Kai.Duncan Sands2012-10-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165792 91177308-0d34-0410-b5e6-96231b3b80d8
* Use unsigned long long instead of uin64_t for OS where that matters.Nick Kledzik2012-10-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165147 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't call getAsUnsignedInteger directly, it fails to compile if uint64_t is ↵Benjamin Kramer2012-10-03
| | | | | | | | not "unsigned long long". while there add more test cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165140 91177308-0d34-0410-b5e6-96231b3b80d8
* Add getAsUnsignedInteger test case that checks that known bad values are ↵Nick Kledzik2012-10-03
| | | | | | rejected git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165136 91177308-0d34-0410-b5e6-96231b3b80d8
* APFloat::roundToIntegral: Special values don't keep the exponent value up to ↵Benjamin Kramer2012-09-26
| | | | | | | | date, don't rely on it. Add a couple of unit tests for special floats. Fixes 13929, found by MemorySanitizer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164698 91177308-0d34-0410-b5e6-96231b3b80d8