aboutsummaryrefslogtreecommitdiffstats
path: root/unittests/ADT/IntervalMapTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/ADT/IntervalMapTest.cpp')
-rw-r--r--unittests/ADT/IntervalMapTest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/unittests/ADT/IntervalMapTest.cpp b/unittests/ADT/IntervalMapTest.cpp
index 5c8b61f278..c7def84340 100644
--- a/unittests/ADT/IntervalMapTest.cpp
+++ b/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