Skip to content

Commit a8368aa

Browse files
committed
[lldb][test] Turn std::atomic libcxx test generic
Split out from llvm#146740
1 parent dd495f1 commit a8368aa

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
CXX_SOURCES := main.cpp
2-
CXXFLAGS_EXTRAS := -std=c++11
3-
USE_LIBCPP := 1
42

53
include Makefile.rules

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py renamed to lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/atomic/TestStdAtomic.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,15 @@
99
from lldbsuite.test import lldbutil
1010

1111

12-
class LibCxxAtomicTestCase(TestBase):
12+
class StdAtomicTestCase(TestBase):
1313
def get_variable(self, name):
1414
var = self.frame().FindVariable(name)
1515
var.SetPreferDynamicValue(lldb.eDynamicCanRunTarget)
1616
var.SetPreferSyntheticValue(True)
1717
return var
1818

19-
@skipIf(compiler=["gcc"])
20-
@add_test_categories(["libc++"])
21-
def test(self):
22-
"""Test that std::atomic as defined by libc++ is correctly printed by LLDB"""
23-
self.build()
19+
def do_test(self):
20+
"""Test that std::atomic is correctly printed by LLDB"""
2421
self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
2522

2623
bkpt = self.target().FindBreakpointByID(
@@ -31,8 +28,6 @@ def test(self):
3128

3229
self.runCmd("run", RUN_SUCCEEDED)
3330

34-
lldbutil.skip_if_library_missing(self, self.target(), re.compile(r"libc\+\+"))
35-
3631
# The stop reason of the thread should be breakpoint.
3732
self.expect(
3833
"thread list",
@@ -66,3 +61,15 @@ def test(self):
6661
self.expect(
6762
"frame var p.child.parent", substrs=["p.child.parent = {\n Value = 0x"]
6863
)
64+
65+
@skipIf(compiler=["gcc"])
66+
@add_test_categories(["libstdcxx"])
67+
def test_libcxx(self):
68+
self.build(dictionary={"USE_LIBCPP" : 1})
69+
self.do_test()
70+
71+
@skipIf(compiler=["gcc"])
72+
@add_test_categories(["libc++"])
73+
def test_libstdcxx(self):
74+
self.build(dictionary={"USE_LIBSTDCPP" : 1})
75+
self.do_test()

0 commit comments

Comments
 (0)