Skip to content

Commit 130de69

Browse files
Michael137github-actions[bot]
authored andcommitted
Automerge: [lldb][test] Move std::span from libcxx to generic directory (#147680)
This just moves the test from `libcxx` to `generic`. There are currently no `std::span` formatters for libstdc++ so I didn't add a test-case for it. Split out from llvm/llvm-project#146740
2 parents 1d2942d + b0cc186 commit 130de69

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
CXX_SOURCES := main.cpp
2-
3-
USE_LIBCPP := 1
4-
52
CXXFLAGS_EXTRAS := -std=c++20
63

74
include Makefile.rules
Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from lldbsuite.test import lldbutil
99

1010

11-
class LibcxxSpanDataFormatterTestCase(TestBase):
11+
class StdSpanDataFormatterTestCase(TestBase):
1212
def findVariable(self, name):
1313
var = self.frame().FindVariable(name)
1414
self.assertTrue(var.IsValid())
@@ -44,11 +44,8 @@ def check_numbers(self, var_name):
4444
self.expect_var_path(f"{var_name}[3]", type="int", value="1234")
4545
self.expect_var_path(f"{var_name}[4]", type="int", value="12345")
4646

47-
@add_test_categories(["libc++"])
48-
@skipIf(compiler="clang", compiler_version=["<", "11.0"])
49-
def test_with_run_command(self):
47+
def do_test(self):
5048
"""Test that std::span variables are formatted correctly when printed."""
51-
self.build()
5249
(self.target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
5350
self, "break here", lldb.SBFileSpec("main.cpp", False)
5451
)
@@ -158,11 +155,14 @@ def test_with_run_command(self):
158155
)
159156
self.check_size("nested", 2)
160157

161-
@add_test_categories(["libc++"])
162158
@skipIf(compiler="clang", compiler_version=["<", "11.0"])
163-
def test_ref_and_ptr(self):
159+
@add_test_categories(["libc++"])
160+
def test_libcxx(self):
161+
self.build(dictionary={"USE_LIBCPP": 1})
162+
self.do_test()
163+
164+
def do_test_ref_and_ptr(self):
164165
"""Test that std::span is correctly formatted when passed by ref and ptr"""
165-
self.build()
166166
(self.target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
167167
self, "Stop here to check by ref", lldb.SBFileSpec("main.cpp", False)
168168
)
@@ -173,3 +173,9 @@ def test_ref_and_ptr(self):
173173
# The pointer should just show the right number of elements:
174174

175175
self.expect("frame variable ptr", patterns=["ptr = 0x[0-9a-f]+ size=5"])
176+
177+
@skipIf(compiler="clang", compiler_version=["<", "11.0"])
178+
@add_test_categories(["libc++"])
179+
def test_ref_and_ptr_libcxx(self):
180+
self.build(dictionary={"USE_LIBCPP": 1})
181+
self.do_test_ref_and_ptr()

0 commit comments

Comments
 (0)