summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/IntegersSubsetTest.cpp
diff options
context:
space:
mode:
authorStepan Dyatkovskiy <stpworld@narod.ru>2012-07-02 13:02:18 +0000
committerStepan Dyatkovskiy <stpworld@narod.ru>2012-07-02 13:02:18 +0000
commit8b9ecca42d2bc2c9d3741d3a15a2fb306b821ab1 (patch)
tree63a0392527015694b32b2c3cb5416d915b55d2f6 /llvm/unittests/Support/IntegersSubsetTest.cpp
parenta5a29f970eea116b38064453d21066127473171c (diff)
downloadbcm5719-llvm-8b9ecca42d2bc2c9d3741d3a15a2fb306b821ab1.tar.gz
bcm5719-llvm-8b9ecca42d2bc2c9d3741d3a15a2fb306b821ab1.zip
IntRange:
- 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
Diffstat (limited to 'llvm/unittests/Support/IntegersSubsetTest.cpp')
-rw-r--r--llvm/unittests/Support/IntegersSubsetTest.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/llvm/unittests/Support/IntegersSubsetTest.cpp b/llvm/unittests/Support/IntegersSubsetTest.cpp
index 5d1dde4c37a..a1031611148 100644
--- a/llvm/unittests/Support/IntegersSubsetTest.cpp
+++ b/llvm/unittests/Support/IntegersSubsetTest.cpp
@@ -193,20 +193,20 @@ namespace {
const unsigned_ranges IntersectRes,
unsigned IntersectResSize
) {
-
+ unsigned successors[2] = {0, 1};
Mapping::RangesCollection Ranges;
Mapping LHSMapping;
for (unsigned i = 0; i < LSize; ++i)
Ranges.push_back(Range(Int(LHS[i][0]), Int(LHS[i][1])));
- LHSMapping.add(Ranges);
+ LHSMapping.add(Ranges, &successors[0]);
Ranges.clear();
Mapping RHSMapping;
for (unsigned i = 0; i < RSize; ++i)
Ranges.push_back(Range(Int(RHS[i][0]), Int(RHS[i][1])));
- RHSMapping.add(Ranges);
+ RHSMapping.add(Ranges, &successors[1]);
Mapping LExclude, Intersection;
@@ -217,8 +217,10 @@ namespace {
unsigned i = 0;
for (Mapping::RangeIterator rei = LExclude.begin(),
- e = LExclude.end(); rei != e; ++rei, ++i)
+ e = LExclude.end(); rei != e; ++rei, ++i) {
EXPECT_EQ(rei->first, Range(ExcludeRes[i][0], ExcludeRes[i][1]));
+ EXPECT_EQ(rei->second, &successors[0]);
+ }
} else
EXPECT_TRUE(LExclude.empty());
@@ -227,8 +229,10 @@ namespace {
unsigned i = 0;
for (Mapping::RangeIterator ii = Intersection.begin(),
- e = Intersection.end(); ii != e; ++ii, ++i)
+ e = Intersection.end(); ii != e; ++ii, ++i) {
EXPECT_EQ(ii->first, Range(IntersectRes[i][0], IntersectRes[i][1]));
+ EXPECT_EQ(ii->second, &successors[0]);
+ }
} else
EXPECT_TRUE(Intersection.empty());
@@ -241,9 +245,11 @@ namespace {
EXPECT_EQ(LExclude.size(), ExcludeResSize);
unsigned i = 0;
- for (Mapping::RangeIterator rei = LExclude.begin(),
- e = LExclude.end(); rei != e; ++rei, ++i)
- EXPECT_EQ(rei->first, Range(ExcludeRes[i][0], ExcludeRes[i][1]));
+ for (Mapping::RangeIterator lei = LExclude.begin(),
+ e = LExclude.end(); lei != e; ++lei, ++i) {
+ EXPECT_EQ(lei->first, Range(ExcludeRes[i][0], ExcludeRes[i][1]));
+ EXPECT_EQ(lei->second, &successors[0]);
+ }
} else
EXPECT_TRUE(LExclude.empty());
}
OpenPOWER on IntegriCloud