summaryrefslogtreecommitdiff
path: root/unittests/Support
Commit message (Collapse)AuthorAge
* Clean up ConstantRange a bit:Nick Lewycky2010-08-11
| | | | | | | | | | - remove ashr which never worked. - fix lshr and shl and add tests. - remove dead function "intersect1Wrapped". - add a new sub method to subtract ranges, with test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110861 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an inverse() method to ConstantRange.Owen Anderson2010-08-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110504 91177308-0d34-0410-b5e6-96231b3b80d8
* add dyn_cast_or_null tests, exclude invalid dyn_cast testGabor Greif2010-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109111 91177308-0d34-0410-b5e6-96231b3b80d8
* tidy upGabor Greif2010-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109110 91177308-0d34-0410-b5e6-96231b3b80d8
* add dyn_cast tests and beef up others a bitGabor Greif2010-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109109 91177308-0d34-0410-b5e6-96231b3b80d8
* tidy upGabor Greif2010-07-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108889 91177308-0d34-0410-b5e6-96231b3b80d8
* migrate essentially everything from under #ifdef DEBUG_CAST_OPERATORS into ↵Gabor Greif2010-07-20
| | | | | | this file git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108864 91177308-0d34-0410-b5e6-96231b3b80d8
* extend to cast<> and cast_or_null<> testsGabor Greif2010-07-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108854 91177308-0d34-0410-b5e6-96231b3b80d8
* isa<> testsGabor Greif2010-07-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108851 91177308-0d34-0410-b5e6-96231b3b80d8
* initial checkin for unittest to exercise Support/Casting.hGabor Greif2010-07-20
| | | | | | | this is still minimal on purpose, but I plan to migrate the ugly hack under #ifdef DEBUG_CAST_OPERATORS into this file git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108849 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix death tests in -Asserts builds.Jeffrey Yasskin2010-03-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98701 91177308-0d34-0410-b5e6-96231b3b80d8
* Spelling fixes.Dan Gohman2010-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97454 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Regex::sub, for doing regular expression substitution with backreferences.Daniel Dunbar2010-02-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96503 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for TypeBuilder<const/volatile void*, false>.Jeffrey Yasskin2010-02-09
| | | | | | | | Thanks to Jochen Wilhelmy for the suggestion! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95677 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix TimeValue::now() on Unix.Torok Edwin2010-01-22
| | | | | | | | | | TimeValue()::now().toEpochTime() is supposed to be the same as time(), but it wasn't, because toEpoch subtracted PosixZeroTime, but now() didn't add PosixZeroTime! Add a unittest to check this works. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94178 91177308-0d34-0410-b5e6-96231b3b80d8
* Catch more cases of a pointer being marked garbage twice. This helps whenRafael Espindola2009-12-18
| | | | | | | | debugging some leaks (PR5770 in particular). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91713 91177308-0d34-0410-b5e6-96231b3b80d8
* Type.h doesn't need to #include LLVMContext.hChris Lattner2009-10-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85254 91177308-0d34-0410-b5e6-96231b3b80d8
* Add raw_ostream::write_escaped, for writing escaped strings.Daniel Dunbar2009-10-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84355 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix http://llvm.org/PR5160, to let CallbackVHs modify other ValueHandles on theJeffrey Yasskin2009-10-12
| | | | | | | same Value without breaking things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83861 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce and use convenience methods for getting pointer typesDuncan Sands2009-10-06
| | | | | | | | where the element is of a basic builtin type. For example, to get an i8* use getInt8PtrTy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83379 91177308-0d34-0410-b5e6-96231b3b80d8
* remove support for "NoSub" from regex. It seems like a minor optimizationChris Lattner2009-09-26
| | | | | | | and makes the API more annoying. Add a Regex::getNumMatches() method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82877 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a compile failure introduced by r82675 on MinGW which doesn't haveJeffrey Yasskin2009-09-25
| | | | | | | | setenv(). This patch just disables the test rather than getting putenv() to work. Thanks to Sandeep Patel for reporting the problem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82797 91177308-0d34-0410-b5e6-96231b3b80d8
* add and document regex support for FileCheck. You can now do stuff like:Chris Lattner2009-09-24
| | | | | | | | | | ; CHECK: movl {{%e[a-z][xi]}}, %eax or whatever. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82717 91177308-0d34-0410-b5e6-96231b3b80d8
* Roll back r82348, which introduced an infinite loop in ParseCStringVector() thatJeffrey Yasskin2009-09-24
| | | | | | | | | a trivial unittest would have caught. This revision also adds the trivial unittest. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82675 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop the raw_ostream required buffer size to 1.Daniel Dunbar2009-09-15
| | | | | | | - As best I can tell, we have eliminated all the code which used to require a larger buffer size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81912 91177308-0d34-0410-b5e6-96231b3b80d8
* Make TypeBuilder's result depend on the LLVMContext it's passed.Jeffrey Yasskin2009-09-09
| | | | | | | | | TypeBuilder was using a local static variable to cache its result. This made it ignore changes in its LLVMContext argument and always return a type constructed from the argument to the first call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81316 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify, now that gtest supports raw_ostream directly.Daniel Dunbar2009-09-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81102 91177308-0d34-0410-b5e6-96231b3b80d8
* Now that googletest can print ConstantRange, use EXPECT_EQ when testing forNick Lewycky2009-09-05
| | | | | | | | equality. Prefer EXPECT_EQ(foo, Full) over EXPECT_TRUE(foo.isFullSet()) because the former will print out the contents of the constant range that failed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81094 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach googletest to use raw_ostream instead of just std::ostream.Jeffrey Yasskin2009-09-05
| | | | | | | | | This can break when there are implicit conversions from types raw_ostream understands but std::ostream doesn't, but it increases the number of cases that Just Work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81093 91177308-0d34-0410-b5e6-96231b3b80d8
* Add regular expression matching support, based on OpenBSD regexec()/regcomp()Torok Edwin2009-08-30
| | | | | | | implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80493 91177308-0d34-0410-b5e6-96231b3b80d8
* split raw_os_ostream out to its own header and implementation file. ThisChris Lattner2009-08-24
| | | | | | | | means that raw_ostream no longer has to #include <iosfwd>. Nothing in llvm should use raw_os_ostream.h, but llvm-gcc and some unit tests do. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79886 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak unit tests.Daniel Dunbar2009-08-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79879 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix off-by-one in llvm::Format::print.Daniel Dunbar2009-08-23
| | | | | | | | | | | | | - This also shortens the Format.h implementation, and uses the print buffer fully (it was wasting a character). - This manifested as llvm-test failures, because one side effect was that raw_ostream would write garbage '\x00' values into the output stream if it happened that the string was at the end of the buffer. This meant that grep would report 'Binary file matches', which meant the silly pattern matching llvm-test eventually does would fail. Cute. :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79862 91177308-0d34-0410-b5e6-96231b3b80d8
* convert all the constant range EXPECT_EQ tests to use EXPECT_TRUE since Chris Lattner2009-08-23
| | | | | | | ConstantRange doesn't have an std::ostream inserter anymore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79831 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed header comment.Misha Brukman2009-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79536 91177308-0d34-0410-b5e6-96231b3b80d8
* Add min and max tests.Daniel Dunbar2009-08-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79454 91177308-0d34-0410-b5e6-96231b3b80d8
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix unit test on FreeBSD. We need to make sure there is enough space to save ↵Benjamin Kramer2009-08-12
| | | | | | the pointer even if the memory returned from malloc was already aligned. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78805 91177308-0d34-0410-b5e6-96231b3b80d8
* To catch bugs like the one fixed inJeffrey Yasskin2009-08-07
| | | | | | | | | | | | | | http://llvm.org/viewvc/llvm-project?view=rev&revision=78127, I'm changing the ExecutionEngine's global mappings to hold AssertingVH<const GlobalValue>. That way, if unregistering a mapping fails to actually unregister it, we'll get an assert. Running the jit nightly tests didn't uncover any actual instances of the problem. This also uncovered the fact that AssertingVH<const X> didn't work, so I fixed that too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78400 91177308-0d34-0410-b5e6-96231b3b80d8
* Update unit test.Owen Anderson2009-08-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78260 91177308-0d34-0410-b5e6-96231b3b80d8
* Update unittest for LLVM API change.Benjamin Kramer2009-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77730 91177308-0d34-0410-b5e6-96231b3b80d8
* Move a few more APIs back to 2.5 forms. The only remaining ones left to ↵Owen Anderson2009-07-31
| | | | | | | | | change back are metadata related, which I'm waiting on to avoid conflicting with Devang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77721 91177308-0d34-0410-b5e6-96231b3b80d8
* Move types back to the 2.5 API.Owen Anderson2009-07-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77516 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a test and fixed a bug in BumpPtrAllocator relating to large alignmentReid Kleckner2009-07-25
| | | | | | | values. Hopefully this fixes PR4622. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77088 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson2009-07-24
| | | | | | thanks to contexts-on-types. More to come. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77011 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-committing changes from r76825 to BumpPtrAllocator with a fix and tests forReid Kleckner2009-07-23
| | | | | | | an off-by-one error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76891 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting r76825 and r76828, since they caused clang runtime errors and some ↵Reid Kleckner2009-07-23
| | | | | | build failure involving memset. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76838 91177308-0d34-0410-b5e6-96231b3b80d8
* Parameterize the BumpPtrAllocator over a slab allocator. It defaults to usingReid Kleckner2009-07-23
| | | | | | | | | | | | malloc, so there should be no functional changes to other code. These changes are necessary since I have plans to use this allocator in the JIT memory manager, and it needs a special allocator. I also added some tests which helped me pinpoint some bugs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76825 91177308-0d34-0410-b5e6-96231b3b80d8
* cast signed APInt constructor params to uint64_t to suppress signedness warningRyan Flynn2009-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76744 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix ConstantRange::unionWith. Also make it work a little hard in some cases toNick Lewycky2009-07-19
| | | | | | | | return the smallest union of two ranges instead of just any range that happens to contain the union. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76360 91177308-0d34-0410-b5e6-96231b3b80d8