Skip to content

[lldb][test] Move std::unordered_map::iterator from libcxx to generic… #147703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
CXX_SOURCES := main.cpp

USE_LIBCPP := 1

CXXFLAGS_EXTRAS := -O0
include Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from lldbsuite.test import lldbutil


class LibcxxUnorderedMapDataFormatterTestCase(TestBase):
class StdUnorderedMapDataFormatterTestCase(TestBase):
def check_ptr_or_ref(self, var_name: str):
var = self.frame().FindVariable(var_name)
self.assertTrue(var)
Expand All @@ -32,12 +32,10 @@ def check_ptr_ptr(self, var_name: str):
self.assertEqual(pair.GetChildAtIndex(0).summary, '"Hello"')
self.assertEqual(pair.GetChildAtIndex(1).summary, '"World"')

@add_test_categories(["libc++"])
def test_iterator_formatters(self):
def do_test(self):
"""Test that std::unordered_map related structures are formatted correctly when printed.
Currently only tests format of std::unordered_map iterators.
"""
self.build()
(self.target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
self, "Break here", lldb.SBFileSpec("main.cpp", False)
)
Expand Down Expand Up @@ -105,13 +103,12 @@ def test_iterator_formatters(self):
type="const StringMapT *const &",
)

@expectedFailureAll(
bugnumber="https://github.com/llvm/llvm-project/issues/146040",
compiler="clang",
compiler_version=["<", "21"],
)
@add_test_categories(["libc++"])
def test_ptr_formatters(self):
def test_libcxx(self):
self.build(dictionary={"USE_LIBCPP": 1})
self.do_test()

def do_test_ptr(self):
"""
Test that pointers to std::unordered_map are formatted correctly.
"""
Expand All @@ -127,3 +124,13 @@ def test_ptr_formatters(self):
self.check_ptr_ptr("ptr4")
self.check_ptr_ptr("ptr5")
self.check_ptr_ptr("ptr6")

@expectedFailureAll(
bugnumber="https://github.com/llvm/llvm-project/issues/146040",
compiler="clang",
compiler_version=["<", "21"],
)
@add_test_categories(["libc++"])
def test_ptr_libcxx(self):
self.build(dictionary={"USE_LIBCPP": 1})
self.do_test_ptr()
Loading