llvm-6502/unittests
Chandler Carruth 40dab1059e Bring TinyPtrVector under test. Somehow we never picked up unit tests
for this class. These tests exercise most of the basic properties, but
the API for TinyPtrVector is very strange currently. My plan is to start
fleshing out the API to match that of SmallVector, but I wanted a test
for what is there first.

Sadly, it doesn't look reasonable to just re-use the SmallVector tests,
as this container can only ever store pointers, and much of the
SmallVector testing is to get construction and destruction right.

Just to get this basic test working, I had to add value_type to the
interface.

While here I found a subtle bug in the combination of 'erase', 'begin',
and 'end'. Both 'begin' and 'end' wanted to use a null pointer to
indicate the "end" iterator of an empty vector, regardless of whether
there is actually a vector allocated or the pointer union is null.
Everything else was fine with this except for erase. If you erase the
last element of a vector after it has held more than one element, we
return the end iterator of the underlying SmallVector which need not be
a null pointer. Instead, simply use the pointer, and poniter + size()
begin/end definitions in the tiny case, and delegate to the inner vector
whenever it is present.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161024 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 02:48:31 +00:00
..
ADT Bring TinyPtrVector under test. Somehow we never picked up unit tests 2012-07-31 02:48:31 +00:00
Analysis llvm/unittests: Simplify LINK_COMPONENTS. 2012-06-21 22:17:51 +00:00
Bitcode llvm/unittests: Simplify LINK_COMPONENTS. 2012-06-21 22:17:51 +00:00
ExecutionEngine Move llvm/Support/TypeBuilder.h -> llvm/TypeBuilder.h. This completes 2012-07-15 23:45:24 +00:00
Support make ConstantRange::zeroExtend() optimal 2012-07-23 20:33:29 +00:00
Transforms Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.h 2012-06-29 12:38:19 +00:00
VMCore Add support for attaching branch weight metadata directly from the IRBuilder. 2012-07-16 07:45:06 +00:00
CMakeLists.txt Completely refactor the structuring of unittest CMake files to match the 2012-06-21 09:51:26 +00:00
Makefile Undo the hack in r147427 and move this unittest to a better home. This 2012-01-02 09:19:48 +00:00
Makefile.unittest build/unittests: Fix llvm-config names for gtest libraries, and bring Makefile 2011-12-15 23:35:08 +00:00