aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ADT/IntervalMapTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/ADT/IntervalMapTest.cpp')
-rw-r--r--llvm/unittests/ADT/IntervalMapTest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/IntervalMapTest.cpp b/llvm/unittests/ADT/IntervalMapTest.cpp
index 5c8b61f..c7def84 100644
--- a/llvm/unittests/ADT/IntervalMapTest.cpp
+++ b/llvm/unittests/ADT/IntervalMapTest.cpp
@@ -352,6 +352,16 @@ TEST(IntervalMapTest, Branched) {
EXPECT_FALSE(I.valid());
EXPECT_TRUE(I == map.end());
+ // Backwards iteration.
+ for (unsigned i = 99; i; --i) {
+ --I;
+ ASSERT_TRUE(I.valid());
+ EXPECT_EQ(10*i, I.start());
+ EXPECT_EQ(10*i+5, I.stop());
+ EXPECT_EQ(i, *I);
+ }
+ EXPECT_TRUE(I == map.begin());
+
}
} // namespace