summaryrefslogtreecommitdiff
path: root/unittests
Commit message (Collapse)AuthorAge
* 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
* Use an export list when building JIT unittests. <rdar://problem/12473675>Bob Wilson2012-10-18
| | | | | | | | | When building with LTO, the internalize pass is hiding some global symbols that are necessary for the JIT unittests. It seems like that may be a bug in LTO to do that by default, but until that gets fixed, this change makes sure that we export the necessary symbols for the tests to pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166220 91177308-0d34-0410-b5e6-96231b3b80d8
* Marked this variable as 'used' so that LTO doesn't get rid of it.Bill Wendling2012-10-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166092 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
* JITTest.cpp: Use LLVM_ATTRIBUTE_USED, rather than __attribute__ directly!NAKAMURA Takumi2012-10-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165790 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark function as 'used' so that LTO doesn't try to get rid of it.Bill Wendling2012-10-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165781 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r165777, "Mark function as 'used' so that LTO doesn't try to get rid ↵NAKAMURA Takumi2012-10-12
| | | | | | of it." git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165780 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark function as 'used' so that LTO doesn't try to get rid of it.Bill Wendling2012-10-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165777 91177308-0d34-0410-b5e6-96231b3b80d8
* Casting.h: Automatically handle isa<Base>(Derived).Sean Silva2012-10-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Additionally, all such cases are handled with no dynamic check. All `classof()` of the form class Foo { [...] static bool classof(const Bar *) { return true; } [...] } where Foo is an ancestor of Bar are no longer necessary. Don't write them! Note: The exact test is `is_base_of<Foo, Bar>`, which is non-strict, so that Foo is considered an ancestor of itself. This leads to the following rule of thumb for LLVM-style RTTI: The argument type of `classof()` should be a strict ancestor. For more information about implementing LLVM-style RTTI, see docs/HowToSetUpLLVMStyleRTTI.rst git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165765 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetData to DataLayout.Micah Villmow2012-10-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165403 91177308-0d34-0410-b5e6-96231b3b80d8
* Some regression tests which are testing the old jit and are exercising ↵James Molloy2012-10-08
| | | | | | | | | | functionality which is both known to be broken and not expected to be fixed in the old jit. To remove these from the regression test output, I've marked them XFAIL (for lit tests) and ifdef'd them out (unit tests). These modifications remove the last long-standing regression test failures from the buildbots (though updating the triple to reflect new ubuntu configuration has temporarily caused some new failures). Tested on x86-64 and ARM Linux. Patch by David Tweed! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165390 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding MCJIT and MemoryBuffer unit testsAndrew Kaylor2012-10-04
| | | | | | Patch by Daniel Malea. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165246 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
* Removing dependency on third party library for Intel JIT event support.Andrew Kaylor2012-09-28
| | | | | | Patch committed on behalf of Kirill Uhanov git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164831 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix of hang during Intel JIT profilingAndrew Kaylor2012-09-26
| | | | | | | Committed on behalf of Kirill Uhanov git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164736 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded and invalid SetInsertPoint calls from unittest.Benjamin Kramer2012-09-26
| | | | | | BB->end() returns a sentinel value that is not a legal insert point. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164699 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
* Expansions for u/srem, using the udiv expansion. More unit tests for udiv ↵Michael Ilseman2012-09-26
| | | | | | | | | | and u/srem. Fixed issue with Release build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164654 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r164614 to appease the buildbots.Chad Rosier2012-09-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164627 91177308-0d34-0410-b5e6-96231b3b80d8
* Expansions for u/srem, using the udiv expansion. More unit tests for udiv ↵Michael Ilseman2012-09-25
| | | | | | and u/srem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164614 91177308-0d34-0410-b5e6-96231b3b80d8
* Unit tests for IntegerDivision. Currently, just a basic sanity check to ↵Michael Ilseman2012-09-25
| | | | | | ensure that the code was generated properly. Future work would be finding some way to test the actual result that would be computed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164582 91177308-0d34-0410-b5e6-96231b3b80d8
* This patch adds memory support functions which will later be used to ↵Andrew Kaylor2012-09-19
| | | | | | implement section-specific protection handling in MCJIT. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164249 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix includes of llvm files that used angle brackets.Craig Topper2012-09-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163979 91177308-0d34-0410-b5e6-96231b3b80d8
* cmake: Fix file path.Daniel Dunbar2012-09-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163950 91177308-0d34-0410-b5e6-96231b3b80d8
* formatted_raw_ostream: Fix a serious bug in tell().Daniel Dunbar2012-09-14
| | | | | | | | | - 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163948 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix up erroneous alignas usage while making this portable to GCC 4.7David Blaikie2012-09-14
| | | | | | Review by Chandler Carruth. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163944 91177308-0d34-0410-b5e6-96231b3b80d8
* ADTTests: [CMake] Exclude DenseMapTest.cpp and SmallVectorTest.cpp on MSVC9 ↵NAKAMURA Takumi2012-08-30
| | | | | | due to its bug. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162918 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't pass a null pointer to cast<> in its unit tests.Richard Smith2012-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162310 91177308-0d34-0410-b5e6-96231b3b80d8
* DataExtractor: Fix integer truncation issues in LEB128 extraction.Benjamin Kramer2012-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162201 91177308-0d34-0410-b5e6-96231b3b80d8
* Flatten the aligned-char-array utility template to be a directlyChandler Carruth2012-08-17
| | | | | | | templated union at the request of Richard Smith. This makes it substantially easier to type. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162072 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly test the LLVM_USE_RVALUE_REFERENCES macro.Michael J. Spencer2012-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161979 91177308-0d34-0410-b5e6-96231b3b80d8
* [PathV2] Add mapped_file_region. Implementation for Windows and POSIX.Michael J. Spencer2012-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161976 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix another roundToIntegral bug where very large values could become ↵Owen Anderson2012-08-15
| | | | | | infinity. Problem and solution identified by Steve Canon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161969 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a problem with APFloat::roundToIntegral where it would return incorrect ↵Owen Anderson2012-08-15
| | | | | | results for negative inputs to trunc. Add unit tests to verify this behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161929 91177308-0d34-0410-b5e6-96231b3b80d8
* Added test for non-static use of cl::opt (fixed in r160170)Alexander Kornienko2012-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161751 91177308-0d34-0410-b5e6-96231b3b80d8
* Update cmake build.Benjamin Kramer2012-08-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161297 91177308-0d34-0410-b5e6-96231b3b80d8
* Postpone the deletion of the old name in StructType::setName to allow using ↵Benjamin Kramer2012-08-04
| | | | | | | | a slice of the old name. Fixes PR13522. Add a rudimentary unit test to exercise the behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161296 91177308-0d34-0410-b5e6-96231b3b80d8
* Add range erase, element insert, and range insert methods toChandler Carruth2012-08-01
| | | | | | | | | | | | | | | 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. ;] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161104 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial commit of new FileOutputBuffer support class. Nick Kledzik2012-08-01
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161099 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement MipsJITInfo::replaceMachineCodeForFunction.Akira Hatanaka2012-08-01
| | | | | | | | | | | No new test case is added. This patch makes test JITTest.FunctionIsRecompiledAndRelinked pass on mips platform. Patch by Petar Jovanovic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161098 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress stderr noise when test case runs.Nick Kledzik2012-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161085 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement copy and move assignment for TinyPtrVector. These try toChandler Carruth2012-07-31
| | | | | | re-use allocated vectors as much as possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161041 91177308-0d34-0410-b5e6-96231b3b80d8
* Bring TinyPtrVector under test. Somehow we never picked up unit testsChandler Carruth2012-07-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Move the SmallVector unit tests to be type-parameterized so that we canChandler Carruth2012-07-30
| | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161001 91177308-0d34-0410-b5e6-96231b3b80d8