summaryrefslogtreecommitdiff
path: root/unittests/ADT/SmallPtrSetTest.cpp
AgeCommit message (Collapse)Author
2017-06-06Re-sort #include lines for unittests. This uses a slightly modifiedChandler Carruth
clang-format (https://reviews.llvm.org/D33932) to keep primary headers at the top and handle new utility headers like 'gmock' consistently with other utility headers. No other change was made. I did no manual edits, all of this is clang-format. This should allow other changes to have more clear and focused diffs, and is especially motivated by moving some headers into more focused libraries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304786 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07ADT: Fix SmallPtrSet iterators in reverse modeDuncan P. N. Exon Smith
Fix SmallPtrSet::iterator behaviour and creation ReverseIterate is true. - Any function that creates an iterator now uses SmallPtrSet::makeIterator, which creates an iterator that dereferences to the given pointer. - In reverse-iterate mode, initialze iterator::End with "CurArray" instead of EndPointer. - In reverse-iterate mode, the current node is iterator::Buffer[-1]. iterator::operator* and SmallPtrSet::makeIterator are the only ones that need to know. - Fix the assertions for reverse-iterate mode. This fixes the tests Danny B added in r297182, and adds a couple of others to confirm that dereferencing does the right thing, regardless of how the iterator was found, and that iteration works correctly from each return from find. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297234 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07Add unit tests for changes to SmallPtrSet and PointerLikeTypeTraitsDaniel Berlin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297182 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22[ADT] Add initializer list support to SmallPtrSet so that sets can beChandler Carruth
easily initialized with some initial values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287610 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29SmallPtrSetTest: More checks for the swap() testingMatthias Braun
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259152 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29SmallPtrSetTest: Check that iterators are still valid after erase()Matthias Braun
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259151 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-02[C++11] Switch all uses of the llvm_move macro to use std::moveChandler Carruth
directly, and remove the macro. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202612 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-01[C++11] Remove uses of LLVM_HAS_RVALUE_REFERENCES from the unittests.Chandler Carruth
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202583 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-20Make the moved-from SmallPtrSet be a valid, empty, small-state object.Chandler Carruth
Enhance the tests to actually require moves in C++11 mode, in addition to testing the moved-from state. Further enhance the tests to cover copy-assignment into a moved-from object and moving a large-state object. (Note that we can't really test small-state vs. large-state as that isn't an observable property of the API really.) This should finish addressing review on r195239. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195261 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-20Add a test for assignment operator behavior which was changed inChandler Carruth
r195239, as well as a comment about the fact that assigning over a moved-from object was in fact tested. Addresses some of the review feedback on r195239. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195260 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-20Give SmallPtrSet move semantics when we have R-value references.Chandler Carruth
Somehow, this ADT got missed which is moderately terrifying considering the efficiency of move for it. The code to implement move semantics for it is pretty horrible currently but was written to reasonably closely match the rest of the code. Unittests that cover both copying and moving (at a basic level) added. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195239 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-29SmallVector and SmallPtrSet allocations now power-of-two aligned.Jean-Luc Duprat
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
2013-03-29Revert "Fix allocations of SmallVector and SmallPtrSet so they are more ↵Rafael Espindola
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
2013-03-29Fix allocations of SmallVector and SmallPtrSet so they are more prone toJean-Luc Duprat
being power-of-two sized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178332 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-06SmallPtrSet: Provide a more efficient implementation of swap than the ↵Benjamin Kramer
default triple-copy std::swap. This currently assumes that both sets have the same SmallSize to keep the implementation simple, a limitation that can be lifted if someone cares. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152143 91177308-0d34-0410-b5e6-96231b3b80d8