summaryrefslogtreecommitdiffstats
path: root/llvm/unittests
Commit message (Collapse)AuthorAgeFilesLines
* Revert r164614 to appease the buildbots.Chad Rosier2012-09-251-97/+0
| | | | llvm-svn: 164627
* Expansions for u/srem, using the udiv expansion. More unit tests for udiv ↵Michael Ilseman2012-09-251-0/+97
| | | | | | and u/srem. llvm-svn: 164614
* Unit tests for IntegerDivision. Currently, just a basic sanity check to ↵Michael Ilseman2012-09-252-0/+55
| | | | | | ensure that the code was generated properly. Future work would be finding some way to test the actual result that would be computed. llvm-svn: 164582
* This patch adds memory support functions which will later be used to ↵Andrew Kaylor2012-09-192-0/+357
| | | | | | implement section-specific protection handling in MCJIT. llvm-svn: 164249
* Fix includes of llvm files that used angle brackets.Craig Topper2012-09-152-9/+9
| | | | llvm-svn: 163979
* cmake: Fix file path.Daniel Dunbar2012-09-141-1/+1
| | | | llvm-svn: 163950
* formatted_raw_ostream: Fix a serious bug in tell().Daniel Dunbar2012-09-142-1/+35
| | | | | | | | | - The current_pos function is supposed to return all the written bytes, not the current position of the underlying stream. - This caused tell() to be broken whenever the underlying stream had buffered content. llvm-svn: 163948
* Fix up erroneous alignas usage while making this portable to GCC 4.7David Blaikie2012-09-141-71/+47
| | | | | | Review by Chandler Carruth. llvm-svn: 163944
* ADTTests: [CMake] Exclude DenseMapTest.cpp and SmallVectorTest.cpp on MSVC9 ↵NAKAMURA Takumi2012-08-301-1/+14
| | | | | | due to its bug. llvm-svn: 162918
* Don't pass a null pointer to cast<> in its unit tests.Richard Smith2012-08-211-3/+5
| | | | llvm-svn: 162310
* DataExtractor: Fix integer truncation issues in LEB128 extraction.Benjamin Kramer2012-08-201-0/+9
| | | | llvm-svn: 162201
* Flatten the aligned-char-array utility template to be a directlyChandler Carruth2012-08-171-117/+117
| | | | | | | templated union at the request of Richard Smith. This makes it substantially easier to type. =] llvm-svn: 162072
* Properly test the LLVM_USE_RVALUE_REFERENCES macro.Michael J. Spencer2012-08-151-1/+1
| | | | llvm-svn: 161979
* [PathV2] Add mapped_file_region. Implementation for Windows and POSIX.Michael J. Spencer2012-08-151-26/+33
| | | | llvm-svn: 161976
* Fix another roundToIntegral bug where very large values could become ↵Owen Anderson2012-08-151-1/+14
| | | | | | infinity. Problem and solution identified by Steve Canon. llvm-svn: 161969
* Fix a problem with APFloat::roundToIntegral where it would return incorrect ↵Owen Anderson2012-08-151-0/+30
| | | | | | results for negative inputs to trunc. Add unit tests to verify this behavior. llvm-svn: 161929
* Added test for non-static use of cl::opt (fixed in r160170)Alexander Kornienko2012-08-131-0/+11
| | | | llvm-svn: 161751
* Update cmake build.Benjamin Kramer2012-08-041-0/+1
| | | | llvm-svn: 161297
* Postpone the deletion of the old name in StructType::setName to allow using ↵Benjamin Kramer2012-08-041-0/+30
| | | | | | | | a slice of the old name. Fixes PR13522. Add a rudimentary unit test to exercise the behavior. llvm-svn: 161296
* Add range erase, element insert, and range insert methods toChandler Carruth2012-08-011-0/+91
| | | | | | | | | | | | | | | TinyPtrVector. With these, it is sufficiently functional for my more normal / pedestrian uses. I've not included some r-value reference stuff here because the value type for a TinyPtrVector is, necessarily, just a pointer. I've added tests that cover the basic behavior of these routines, but they aren't as comprehensive as I'd like. In particular, they don't really test the iterator semantics as thoroughly as they should. Maybe some brave soul will feel enterprising and flesh them out. ;] llvm-svn: 161104
* Initial commit of new FileOutputBuffer support class. Nick Kledzik2012-08-012-0/+138
| | | | | | | | Since the llvm::sys::fs::map_file_pages() support function it relies on is not yet implemented on Windows, the unit tests for FileOutputBuffer are currently conditionalized to run only on unix. llvm-svn: 161099
* Implement MipsJITInfo::replaceMachineCodeForFunction.Akira Hatanaka2012-08-011-2/+2
| | | | | | | | | | No new test case is added. This patch makes test JITTest.FunctionIsRecompiledAndRelinked pass on mips platform. Patch by Petar Jovanovic. llvm-svn: 161098
* Suppress stderr noise when test case runs.Nick Kledzik2012-07-311-0/+6
| | | | llvm-svn: 161085
* Implement copy and move assignment for TinyPtrVector. These try toChandler Carruth2012-07-311-0/+166
| | | | | | re-use allocated vectors as much as possible. llvm-svn: 161041
* Bring TinyPtrVector under test. Somehow we never picked up unit testsChandler Carruth2012-07-312-0/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 161024
* Move the SmallVector unit tests to be type-parameterized so that we canChandler Carruth2012-07-301-149/+176
| | | | | | | | | | | | | | | | | | | | test more than a single instantiation of SmallVector. Add testing for 0, 1, 2, and 4 element sized "small" buffers. These appear to be essentially untested in the unit tests until now. Fix several tests to be robust in the face of a '0' small buffer. As a consequence of this size buffer, the growth patterns are actually observable in the test -- yes this means that many tests never caused a grow to occur before. For some tests I've merely added a reserve call to normalize behavior. For others, the growth is actually interesting, and so I captured the fact that growth would occur and adjusted the assertions to not assume how rapidly growth occured. Also update the specialization for a '0' small buffer length to have all the same interface points as the normal small vector. llvm-svn: 161001
* make ConstantRange::zeroExtend() optimalNuno Lopes2012-07-231-0/+4
| | | | llvm-svn: 160643
* teach ConstantRange that zero times X is always zeroNuno Lopes2012-07-161-0/+8
| | | | llvm-svn: 160317
* make ConstantRange::getSetSize() properly compute the size of wrapped and ↵Nuno Lopes2012-07-161-5/+9
| | | | | | | | full sets. Make it always return APInts with the same bitwidth for the same ConstantRange bitwidth to simply clients llvm-svn: 160294
* Add support for attaching branch weight metadata directly from the IRBuilder.Chandler Carruth2012-07-161-0/+11
| | | | | | | | | Added a basic unit test for this with CreateCondBr. I didn't go all the way and test the switch side as the boilerplate for setting up the switch IRBuilder unit tests is a lot more. Fortunately, the two share all the interesting code paths. llvm-svn: 160251
* Add a boring bit of boilerplate to start testing IRBuilder::CreateCondBr.Chandler Carruth2012-07-161-1/+15
| | | | | | | This is in anticipation of changing CreateCondBr and wanting to test those changes. llvm-svn: 160250
* Move the IRBuilder unittest from Support to VMCore. This got missed inChandler Carruth2012-07-163-2/+2
| | | | | | the original move of IRBuilder. llvm-svn: 160249
* Move llvm/Support/TypeBuilder.h -> llvm/TypeBuilder.h. This completesChandler Carruth2012-07-156-6/+6
| | | | | | | | | | | | the move of *Builder classes into the Core library. No uses of this builder in Clang or DragonEgg I could find. If there is a desire to have an IR-building-support library that contains all of these builders, that can be easily added, but currently it seems likely that these add no real overhead to VMCore. llvm-svn: 160243
* Move llvm/Support/MDBuilder.h to llvm/MDBuilder.h, to live withChandler Carruth2012-07-154-4/+4
| | | | | | | | | | | IRBuilder, DIBuilder, etc. This is the proper layering as MDBuilder can't be used (or implemented) without the Core Metadata representation. Patches to Clang and Dragonegg coming up. llvm-svn: 160237
* Revert "IntRange:" as it appears to be breaking self hosting.Eric Christopher2012-07-021-14/+8
| | | | | | This reverts commit b2833d9dcba88c6f0520cad760619200adc0442c. llvm-svn: 159618
* IntRange:Stepan Dyatkovskiy2012-07-021-8/+14
| | | | | | | | | | | | | | | | | | | | | | - Changed isSingleNumber method behaviour. Now this flag is calculated on demand. IntegersSubsetMapping - Optimized diff operation. - Replaced type of Items field from std::list with std::map. - Added new methods: bool isOverlapped(self &RHS) void add(self& RHS, SuccessorClass *S) void detachCase(self& NewMapping, SuccessorClass *Succ) void removeCase(SuccessorClass *Succ) SuccessorClass *findSuccessor(const IntTy& Val) const IntTy* getCaseSingleNumber(SuccessorClass *Succ) IntegersSubsetTest - DiffTest: Added checks for successors. SimplifyCFG Updated SwitchInst usage (now it is case-ragnes compatible) for - SimplifyEqualityComparisonWithOnlyPredecessor - FoldValueComparisonIntoPredecessors llvm-svn: 159527
* Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.hChandler Carruth2012-06-296-21/+24
| | | | | | | | | | | | | | | | | This was always part of the VMCore library out of necessity -- it deals entirely in the IR. The .cpp file in fact was already part of the VMCore library. This is just a mechanical move. I've tried to go through and re-apply the coding standard's preferred header sort, but at 40-ish files, I may have gotten some wrong. Please let me know if so. I'll be committing the corresponding updates to Clang and Polly, and Duncan has DragonEgg. Thanks to Bill and Eric for giving the green light for this bit of cleanup. llvm-svn: 159421
* The DIBuilder class is just a wrapper around debug info creationBill Wendling2012-06-291-1/+1
| | | | | | | (a.k.a. MDNodes). The module doesn't belong in Analysis. Move it to the VMCore instead. llvm-svn: 159414
* add ConstantRange::difference (to perform set difference/relative complement)Nuno Lopes2012-06-281-0/+17
| | | | llvm-svn: 159352
* fix a off-by-one bug in intersectWith(), and add a bunch of testsNuno Lopes2012-06-281-2/+32
| | | | llvm-svn: 159319
* Move lib/Analysis/DebugInfo.cpp to lib/VMCore/DebugInfo.cpp andBill Wendling2012-06-281-3/+3
| | | | | | | | | include/llvm/Analysis/DebugInfo.h to include/llvm/DebugInfo.h. The reasoning is because the DebugInfo module is simply an interface to the debug info MDNodes and has nothing to do with analysis. llvm-svn: 159312
* IntegersSubsetTest: Due to compilation failure with -std=c11, replaced -1UL ↵Stepan Dyatkovskiy2012-06-261-4/+8
| | | | | | with NOT_A_NUMBER constant (0xffff). llvm-svn: 159207
* IntegersSubsetMapping: implemented "diff" operation. Operation allows at the ↵Stepan Dyatkovskiy2012-06-261-0/+143
| | | | | | | | | | | | | same time perform up to three operations: - LHS exclude RHS - LHS intersect RHS (LHS successors will keeped) - RHS exclude LHS The complexity is N+M, where N is size of LHS M is size of RHS. llvm-svn: 159201
* IntegersSubsetMapping: removed exclude operation, it will replaced with more ↵Stepan Dyatkovskiy2012-06-261-174/+0
| | | | | | | | universal "diff" operation in next commit. Changes was separated onto two commits for better readability. llvm-svn: 159200
* unittests/Support/Path.cpp: [Win32] Suppress FileSystemTest.FileMapping for now.NAKAMURA Takumi2012-06-241-0/+2
| | | | llvm-svn: 159099
* unittests/Support/Path.cpp: [Win32] Suppress FileSystemTest.Permissions for now.NAKAMURA Takumi2012-06-241-1/+2
| | | | llvm-svn: 159098
* llvm/unittests: Simplify LINK_COMPONENTS.NAKAMURA Takumi2012-06-219-11/+6
| | | | llvm-svn: 158942
* llvm/unittests/VMCore/CMakeLists.txt: Introduce LLVM_OPTIONAL_SOURCES here, too.NAKAMURA Takumi2012-06-211-0/+6
| | | | llvm-svn: 158941
* llvm/unittests/ExecutionEngine/JIT/CMakeLists.txt: Unbreak build.NAKAMURA Takumi2012-06-211-1/+1
| | | | llvm-svn: 158914
* Add a pragma to supress an MSVC warning on some of the absurd code I'mChandler Carruth2012-06-211-0/+6
| | | | | | | | using to test the alignment support library. Patch from Nikola on IRC. llvm-svn: 158912
OpenPOWER on IntegriCloud