summaryrefslogtreecommitdiff
path: root/unittests/Support/ConstantRangeTest.cpp
Commit message (Collapse)AuthorAge
* 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
* 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
* 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
* 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
* Replace intersectWith with maximalIntersectWith. The latter guarantees thatNick Lewycky2009-07-18
| | | | | | | | | all values belonging to the intersection will belong to the resulting range. The former was inconsistent about that point (either way is fine, just pick one.) This is part of PR4545. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76289 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an error in ConstantRange::getSignedMax on wrapped ranges. Thanks onceNick Lewycky2009-07-13
| | | | | | | again to Daniel Dunbar and KLEE! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75449 91177308-0d34-0410-b5e6-96231b3b80d8
* 'i8 full-range' sign extended to i16 should equal [-128, 128) not [-128, 127).Nick Lewycky2009-07-13
| | | | | | | Found by Daniel Dunbar and KLEE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75448 91177308-0d34-0410-b5e6-96231b3b80d8
* Multiply was very wrong for wrapped ranges. This supplies a half-fix that willNick Lewycky2009-07-13
| | | | | | | generally return Full on all wrapped inputs. "Fixes" PR4545. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75444 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug summing two full sets. The overflow checking doesn't handle sets asNick Lewycky2009-07-13
| | | | | | | | | large as the full set, only those one size smaller. Thanks to Daniel Dunbar who found this bug using Klee! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75443 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement udiv for ConstantRanges.Nick Lewycky2009-07-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75413 91177308-0d34-0410-b5e6-96231b3b80d8
* This is not overly conservative.Nick Lewycky2009-07-12
| | | | | | | | Some = [10, 2730). A subset of that is [1024..2048) which covers every possible 10-bit pattern. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75411 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement ConstantRange::multiply based on the code in LoopVR.Nick Lewycky2009-07-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75410 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix handling of max and full set.Nick Lewycky2009-07-11
| | | | | | | | | A full set is a constant range that represents any number. If you take the umax of that and [5, 10) you end up with [5, INT_MAX] because the values less than 5 would be umax's against a value which is at least 5. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75372 91177308-0d34-0410-b5e6-96231b3b80d8
* Break the world's largest unit test down a few logical lines. No semanticNick Lewycky2009-07-11
| | | | | | | changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75369 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the part of 75177 that split ConstantRange into two classes, andDan Gohman2009-07-09
| | | | | | | | | merge the new functionality and unittests into ConstantRange. Thanks to Nick Lewycky for pointing out that it isn't necessary to have two separate classes here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75191 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a ConstantSignedRange class, which does for signed integersDan Gohman2009-07-09
what ConstantRange does for unsigned integers. Factor out a common base class for common functionality. Add some new functions for performing arithmetic on constant ranges. Some of these are currently just stubbed out with conservative implementations. Add unittests for ConstantRange and ConstantSignedRange. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75177 91177308-0d34-0410-b5e6-96231b3b80d8