summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/DebugInfo/DWARF
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-10-30 18:25:28 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-10-30 18:25:28 +0000
commit7323259de884f4576d78e6492b93fc2455617ef5 (patch)
treed832192fecbf6ab30b4195b1dc023efbb4a95e40 /llvm/unittests/DebugInfo/DWARF
parent98f1dd0bd593fc147bddff45c706542c4c08cadd (diff)
downloadbcm5719-llvm-7323259de884f4576d78e6492b93fc2455617ef5.tar.gz
bcm5719-llvm-7323259de884f4576d78e6492b93fc2455617ef5.zip
[DebugInfo] Define base function on DWARFDie reverse iterators
This defines member function base on the specialization of std::reverse_iterator for DWARFDie::iterator as required by C++ [reverse.iter.conv]. This fixes unit test DWARFDebugInfoTest.cpp under EXPENSIVE_CHECKS which currently can't be built due to GNU C++ Library calling this member function in debug mode. This fixes https://llvm.org/PR38785 Patch by: Eugene Sharygin Differential revision: https://reviews.llvm.org/D53792 llvm-svn: 345621
Diffstat (limited to 'llvm/unittests/DebugInfo/DWARF')
-rw-r--r--llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
index 1be0363adb0..ffbde2df2bc 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
@@ -1227,6 +1227,10 @@ TEST(DWARFDebugInfo, TestRelations) {
EXPECT_THAT(std::vector<DWARFDie>(A.rbegin(), A.rend()),
testing::ElementsAre(D, C, B));
+ // Make sure conversion from reverse iterator works as expected.
+ EXPECT_EQ(A.rbegin().base(), A.end());
+ EXPECT_EQ(A.rend().base(), A.begin());
+
// Make sure iterator is bidirectional.
{
auto Begin = A.begin();
OpenPOWER on IntegriCloud