Skip to content

Commit e7c9f29

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

File tree

4 files changed

+17
-22
lines changed

4 files changed

+17
-22
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
CXX_SOURCES := main.cpp
2-
CXXFLAGS_EXTRAS := -std=c++11
3-
4-
USE_LIBCPP := 1
52

63
include Makefile.rules

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py renamed to lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/initializer_list/TestDataFormatterStdInitializerList.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Test lldb data formatter subsystem.
33
"""
44

5-
65
import re
76
import lldb
87
from lldbsuite.test.decorators import *
@@ -11,10 +10,7 @@
1110

1211

1312
class InitializerListTestCase(TestBase):
14-
@add_test_categories(["libc++"])
15-
def test(self):
16-
"""Test that that file and class static variables display correctly."""
17-
self.build()
13+
def do_test(self):
1814
self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
1915

2016
bkpt = self.target().FindBreakpointByID(
@@ -25,8 +21,6 @@ def test(self):
2521

2622
self.runCmd("run", RUN_SUCCEEDED)
2723

28-
lldbutil.skip_if_library_missing(self, self.target(), re.compile(r"libc\+\+"))
29-
3024
# The stop reason of the thread should be breakpoint.
3125
self.expect(
3226
"thread list",
@@ -39,3 +33,8 @@ def test(self):
3933
"frame variable ils",
4034
substrs=['[4] = "surprise it is a long string!! yay!!"'],
4135
)
36+
37+
@add_test_categories(["libc++"])
38+
def test_libcxx(self):
39+
self.build(dictionary={"USE_LIBCPP": 1})
40+
self.do_test()
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <initializer_list>
2+
#include <string>
3+
#include <vector>
4+
5+
int main() {
6+
std::initializer_list<int> ili{1, 2, 3, 4, 5};
7+
std::initializer_list<std::string> ils{
8+
"1", "2", "3", "4", "surprise it is a long string!! yay!!"};
9+
10+
return 0; // Set break point at this line.
11+
}

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/main.cpp

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)