summaryrefslogtreecommitdiff
path: root/unittests
Commit message (Collapse)AuthorAge
* Move lib/Analysis/DebugInfo.cpp to lib/VMCore/DebugInfo.cpp andBill Wendling2012-06-28
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159312 91177308-0d34-0410-b5e6-96231b3b80d8
* IntegersSubsetTest: Due to compilation failure with -std=c11, replaced -1UL ↵Stepan Dyatkovskiy2012-06-26
| | | | | | with NOT_A_NUMBER constant (0xffff). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159207 91177308-0d34-0410-b5e6-96231b3b80d8
* IntegersSubsetMapping: implemented "diff" operation. Operation allows at the ↵Stepan Dyatkovskiy2012-06-26
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159201 91177308-0d34-0410-b5e6-96231b3b80d8
* IntegersSubsetMapping: removed exclude operation, it will replaced with more ↵Stepan Dyatkovskiy2012-06-26
| | | | | | | | | | universal "diff" operation in next commit. Changes was separated onto two commits for better readability. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159200 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/Support/Path.cpp: [Win32] Suppress FileSystemTest.FileMapping for now.NAKAMURA Takumi2012-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159099 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/Support/Path.cpp: [Win32] Suppress FileSystemTest.Permissions for now.NAKAMURA Takumi2012-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159098 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm/unittests: Simplify LINK_COMPONENTS.NAKAMURA Takumi2012-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158942 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm/unittests/VMCore/CMakeLists.txt: Introduce LLVM_OPTIONAL_SOURCES here, too.NAKAMURA Takumi2012-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158941 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm/unittests/ExecutionEngine/JIT/CMakeLists.txt: Unbreak build.NAKAMURA Takumi2012-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158914 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a pragma to supress an MSVC warning on some of the absurd code I'mChandler Carruth2012-06-21
| | | | | | | | using to test the alignment support library. Patch from Nikola on IRC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158912 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some missing dependencies here that I missed in my first passChandler Carruth2012-06-21
| | | | | | through. Also sort them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158911 91177308-0d34-0410-b5e6-96231b3b80d8
* Completely refactor the structuring of unittest CMake files to match theChandler Carruth2012-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makefiles, the CMake files in every other part of the LLVM tree, and sanity. This should also restore the output tree structure of all the unit tests, sorry for breaking that, and thanks for letting me know. The fundamental change is to put a CMakeLists.txt file in the unittest directory, with a single test binary produced from it. This has several advantages: - No more weird directory stripping in the unittest macro, allowing it to be used more readily in other projects. - No more directory prefixes on all the source files. - Allows correct and precise use of LLVM's per-directory dependency system. - Allows use of the checking logic for source files that have not been added to the CMake build. This uncovered a file being skipped with CMake in LLVM and one in Clang's unit tests. - Makes Specifying conditional compilation or other custom logic for JIT tests easier. It did require adding the concept of an explicit 'optional' source file to the CMake build so that the missing-file check can skip cases where the file is *supposed* to be missing. =] This is another chunk of refactoring the CMake build in order to make it usable for other clients like CompilerRT / ASan / TSan. Note that this is interdependent with a Clang CMake change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158909 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor the logic for setting up a GoogleTest unit test executable intoChandler Carruth2012-06-21
| | | | | | | a helper function in CMake. This will allow us to share all of this logic with Clang, and eventually CompilerRT. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158896 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the naming pattern in the unittests' CMake fileChandler Carruth2012-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158893 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove one of the LLVM-specific CMake hacks in favor of standard CMakeChandler Carruth2012-06-21
| | | | | | | | | | facilities. This was only used in one place in LLVM, and was used pervasively (but with different code!) in Clang. It has no advantages over the standard CMake facilities and in some cases disadvantages. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158889 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix inappropriate use of anonymous namespaces in unittests.Chandler Carruth2012-06-20
| | | | | | | | | | | The TEST_F macros actually declare *subclasses* of the test fixtures. Even if they didn't we don't want them to declare external functions. The entire unit test, including both the fixture class and the fixture test cases should be wrapped in the anonymous namespace. This issue was caught by the new '-Winternal-linkage-in-inline' warning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158798 91177308-0d34-0410-b5e6-96231b3b80d8
* Add permissions(), map_file_pages(), and unmap_file_pages() to llvm::sys::fs ↵Nick Kledzik2012-06-20
| | | | | | and add unit test. Unix is implemented. Windows side needs to be implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158770 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR13148, an inf-loop in StringMap.Chandler Carruth2012-06-19
| | | | | | | | | | | | | | | StringMap suffered from the same bug as DenseMap: when you explicitly construct it with a small number of buckets, you can arrange for the tombstone-based growth path to be followed when the number of buckets was less than '8'. In that case, even with a full map, it would compare '0' as not less than '0', and refuse to grow the table, leading to inf-loops trying to find an empty bucket on the next insertion. The fix is very simple: use '<=' as the comparison. The same fix was applied to DenseMap as well during its recent refactoring. Thanks to Alex Bolz for the great report and test case. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158725 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some superfluous SCOPED_TRACEs from this unit test.Chandler Carruth2012-06-19
| | | | | | | GoogleTest already prints errors with all the information about which test case contained the error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158724 91177308-0d34-0410-b5e6-96231b3b80d8
* For reasons I can't fathom MSVC supports ULL but not LLU suffixes on long ↵Benjamin Kramer2012-06-17
| | | | | | long integer literals. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158648 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing unittest files to the cmake build.Benjamin Kramer2012-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158647 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove SmallMap unittests, unbreaking the build.Benjamin Kramer2012-06-17
| | | | | | I don't know how useful these are for SmallDenseMap, I'll leave that decision to Chandler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158646 91177308-0d34-0410-b5e6-96231b3b80d8
* Bring the return value of SmallVector::insert in line with std::vector::insert.Benjamin Kramer2012-06-17
| | | | | | | | It always returns the iterator for the first inserted element, or the passed in iterator if the inserted range was empty. Flesh out the unit test more and fix all the cases it uncovered so far. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158645 91177308-0d34-0410-b5e6-96231b3b80d8
* SmallVector: return a valid iterator for the rare case of inserting an empty ↵Benjamin Kramer2012-06-17
| | | | | | | | range into a SmallVector. Patch by Johannes Schaub! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158643 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a unit test for 'swap', and fix a pile of bugs inChandler Carruth2012-06-17
| | | | | | | | | | | | | | | SmallDenseMap::swap. First, make it parse cleanly. Yay for uninstantiated methods. Second, make the inline-buckets case work correctly. This is way trickier than it should be due to the uninitialized values in empty and tombstone buckets. Finally fix a few typos that caused construction/destruction mismatches in the counting unittest. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158641 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable a particular assertion on MSVC... I'm deeply disturbed by itsChandler Carruth2012-06-17
| | | | | | implementation of the class layout for the V8 type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158640 91177308-0d34-0410-b5e6-96231b3b80d8
* Add tests for *DenesMap for both key and value types' construction andChandler Carruth2012-06-17
| | | | | | | | | | | | | | | | | | | destruction and fix a bug in SmallDenseMap they caught. This is kind of a poor-man's version of the testing that just adds the addresses to a set on construction and removes them on destruction. We check that double construction and double destruction don't occur. Amusingly enough, this is enough to catch a lot of SmallDenseMap issues because we spend a lot of time with fixed stable addresses in the inline buffer. The SmallDenseMap bug fix included makes grow() not double-destroy in some cases. It also fixes a FIXME there, the code was pretty crappy. We now don't have any wasted initialization, but we do move the entries in inline bucket array an extra time. It's probably a better tradeoff, and is much easier to get correct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158639 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a SmallDenseMap container that re-uses the existing DenseMapChandler Carruth2012-06-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implementation. This type includes an inline bucket array which is used initially. Once it is exceeded, an array of 64 buckets is allocated on the heap. The bucket count grows from there as needed. Some highlights of this implementation: - The inline buffer is very carefully aligned, and so supports types with alignment constraints. - It works hard to avoid aliasing issues. - Supports types with non-trivial constructors, destructors, copy constructions, etc. It works reasonably hard to minimize copies and unnecessary initialization. The most common initialization is to set keys to the empty key, and so that should be fast if at all possible. This class has a performance / space trade-off. It tries to optimize for relatively small maps, and so packs the inline bucket array densely into the object. It will be marginally slower than a normal DenseMap in a few use patterns, so it isn't appropriate everywhere. The unit tests for DenseMap have been generalized a bit to support running over different map implementations in addition to different key/value types. They've then been automatically extended to cover the new container through the magic of GoogleTest's typed tests. All of this is still a bit rough though. I'm going to be cleaning up some aspects of the implementation, documenting things better, and adding tests which include non-trivial types. As soon as I'm comfortable with the correctness, I plan to switch existing users of SmallMap over to this class as it is already more correct w.r.t. construction and destruction of objects iin the map. Thanks to Benjamin Kramer for all the reviews of this and the lead-up patches. That said, more review on this would really be appreciated. As I've noted a few times, I'm quite surprised how hard it is to get the semantics for a hashtable-based map container with a small buffer optimization correct. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158638 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some somewhat exhaustive tests of sizeof properties of this horribleChandler Carruth2012-06-17
| | | | | | construct just for my sanity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158637 91177308-0d34-0410-b5e6-96231b3b80d8
* Update CMake build.Benjamin Kramer2012-06-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158601 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge the SmallBitVector and BitVector unit tests with gtest's typed test ↵Benjamin Kramer2012-06-16
| | | | | | magic and bring SmallBitVector up to date. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158600 91177308-0d34-0410-b5e6-96231b3b80d8
* Relax one assertion -- long double has strange alignments on lots ofChandler Carruth2012-06-16
| | | | | | | | | platforms. Also, remove one assertion on MSVC because it produces a completely preposterous result, claiming something needs 12-byte alignment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158599 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to reduce the size of the array used for compile-time testing byChandler Carruth2012-06-16
| | | | | | making the bounds all '1', and chunking it a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158598 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to the alignment support header for conjuring a characterChandler Carruth2012-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | array of a suitable size and alignment for any of a number of different types to be stored into the character array. The mechanisms for producing an explicitly aligned type are fairly complex because this operation is poorly supported on all compilers. We've spent a fairly significant amount of time experimenting with different implementations inside of Google, and the one using explicitly expanded templates has been the most robust. Credit goes to Nick Lewycky for writing the first 20 versions or so of this logic we had inside of Google. I based this on the only one to actually survive. In case anyone is worried, yes we are both explicitly re-contributing and re-licensing it for LLVM. =] Once the issues with actually specifying the alignment are finished, it turns out that most compilers don't in turn align anything the way they are instructed. Testing of this logic against both Clang and GCC indicate that the alignment constraints are largely ignored by both compilers! I've come up with and used a work-around by wrapping each alignment-hinted type directly in a struct, and using that struct to align the character array through a union. This elaborate hackery is terrifying, but I've included testing that caught a terrifying number of bugs in every other technique I've tried. All of this in order to implement a poor C++98 programmers emulation of C++11 unrestricted unions in classes such as SmallDenseMap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158597 91177308-0d34-0410-b5e6-96231b3b80d8
* Work around a bug with MSVC 10 where it fails to recognize a valid useChandler Carruth2012-06-16
| | | | | | | | | of typename. GCC and Clang were fine with this, but MSVC won't accept it. Fortunately, it also doesn't need it. Yuck. Thanks to Nakamura for pointing this out in IRC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158593 91177308-0d34-0410-b5e6-96231b3b80d8
* Type parameterize the DenseMap unit tests.Chandler Carruth2012-06-16
| | | | | | | | | | | | These were already trying to be type parameterized over different key/value pairs. I've realized this goal using GoogleTest's typed test functionality. This allows us to easily replicate the tests across different key/value combinations and soon different mapping templates. I've fixed a few bugs in the tests and extended them a bit in the process as many tests were only applying to the int->int mapping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158589 91177308-0d34-0410-b5e6-96231b3b80d8
* Round 2 of dead private variable removal.Benjamin Kramer2012-06-06
| | | | | | | | LLVM is now -Wunused-private-field clean except for - lib/MC/MCDisassembler/Disassembler.h. Not sure why it keeps all those unaccessible fields. - gtest. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158096 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix gtest build issue on Visual Studio 2012 RCJustin Holewinski2012-06-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158046 91177308-0d34-0410-b5e6-96231b3b80d8
* IntegersSubsetMapping: added exclude operation, that allows to exclude ↵Stepan Dyatkovskiy2012-06-05
| | | | | | subset of integers from current mapping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157989 91177308-0d34-0410-b5e6-96231b3b80d8
* IntegersSubsetMapping:Stepan Dyatkovskiy2012-06-05
| | | | | | | | | Changed type of Items collection: from std::vector to std::list. Also some small fixes made in IntegersSubset.h, IntegersSubsetMapping.h and IntegersSubsetTest.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157987 91177308-0d34-0410-b5e6-96231b3b80d8
* Added unittests for IntegersSubset and IntegersSubsetMapping.Stepan Dyatkovskiy2012-06-02
| | | | | | | | | | | | - Fixed IntegersSubsetGeneric copy/assignment behaviour. - Fixed IntegersSubsetGeneric::getSize/getSingleValue methods. - Fixed IntegersSubsetGeneric::verify method. Also IntegersSubset.h and IntegersSubsetMapping.h headers was fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157887 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typos found by http://github.com/lyda/misspell-checkBenjamin Kramer2012-06-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157885 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the PTX back-end and all of its artifacts (triple, etc.)Justin Holewinski2012-05-24
| | | | | | | | This back-end was deprecated in favor of the NVPTX back-end. NV_CONTRIB git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157417 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
* fix corner case in ConstantRange::intersectWith().Nuno Lopes2012-05-18
| | | | | | this fixes the missed optimization I was seeing in the CorrelatedValuePropagation pass git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157032 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable JITTest.FunctionIsRecompiledAndRelinked and JITTest.NoStubsSimon Atanasyan2012-05-16
| | | | | | | on MIPS where they are not implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156935 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove warning about testing unsigned int with int.Bill Wendling2012-05-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156812 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed one small stupid, but critical bug.Stepan Dyatkovskiy2012-05-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156810 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the expensive BitVector::operator~().Jakob Stoklund Olesen2012-05-14
| | | | | | | Returning a temporary BitVector is very expensive. If you must, create the temporary explicitly: Use BitVector(A).flip() instead of ~A. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156768 91177308-0d34-0410-b5e6-96231b3b80d8
* Add BitVector::anyCommon().Jakob Stoklund Olesen2012-05-14
| | | | | | The existing operation (A & B).any() is very slow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156760 91177308-0d34-0410-b5e6-96231b3b80d8