Skip to content

Commit ba6f872

Browse files
authored
[lldb][test] Move std::unordered_map::iterator from libcxx to generic… (#147703)
… directory This just moves the test from `libcxx` to `generic`. There are currently no `std::unordered_map::iterator` formatters for libstdc++ so I didn't add a test-case for it. Split out from llvm/llvm-project#146740
1 parent b0cc186 commit ba6f872

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
CXX_SOURCES := main.cpp
22

3-
USE_LIBCPP := 1
4-
5-
CXXFLAGS_EXTRAS := -O0
63
include Makefile.rules
Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from lldbsuite.test import lldbutil
99

1010

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

35-
@add_test_categories(["libc++"])
36-
def test_iterator_formatters(self):
35+
def do_test(self):
3736
"""Test that std::unordered_map related structures are formatted correctly when printed.
3837
Currently only tests format of std::unordered_map iterators.
3938
"""
40-
self.build()
4139
(self.target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
4240
self, "Break here", lldb.SBFileSpec("main.cpp", False)
4341
)
@@ -105,13 +103,12 @@ def test_iterator_formatters(self):
105103
type="const StringMapT *const &",
106104
)
107105

108-
@expectedFailureAll(
109-
bugnumber="https://github.com/llvm/llvm-project/issues/146040",
110-
compiler="clang",
111-
compiler_version=["<", "21"],
112-
)
113106
@add_test_categories(["libc++"])
114-
def test_ptr_formatters(self):
107+
def test_libcxx(self):
108+
self.build(dictionary={"USE_LIBCPP": 1})
109+
self.do_test()
110+
111+
def do_test_ptr(self):
115112
"""
116113
Test that pointers to std::unordered_map are formatted correctly.
117114
"""
@@ -127,3 +124,13 @@ def test_ptr_formatters(self):
127124
self.check_ptr_ptr("ptr4")
128125
self.check_ptr_ptr("ptr5")
129126
self.check_ptr_ptr("ptr6")
127+
128+
@expectedFailureAll(
129+
bugnumber="https://github.com/llvm/llvm-project/issues/146040",
130+
compiler="clang",
131+
compiler_version=["<", "21"],
132+
)
133+
@add_test_categories(["libc++"])
134+
def test_ptr_libcxx(self):
135+
self.build(dictionary={"USE_LIBCPP": 1})
136+
self.do_test_ptr()

0 commit comments

Comments
 (0)