aboutsummaryrefslogtreecommitdiff
path: root/unittests
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
commit92ddcaeaddf86f7169db524168175bac5febfba6 (patch)
tree618fb837e65aff944bcbb5f125532ec040ee1c29 /unittests
parent0a9adfeb4f04b5e0577c76c9eba322f0ba519e65 (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345621 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp b/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
index 1be0363adb0..ffbde2df2bc 100644
--- a/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
+++ b/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();