Skip to content

Commit 4f9e0fe

Browse files
committed
Move DIL tests for shared & unique pointers into existing dataformatter tests.
1 parent fe835ba commit 4f9e0fe

File tree

10 files changed

+28
-123
lines changed

10 files changed

+28
-123
lines changed

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/dil_shared_ptr/Makefile

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

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/dil_shared_ptr/TestFrameVarDILSharedPtrDeref.py

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

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

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

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/dil_unique_ptr/Makefile

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

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/dil_unique_ptr/TestFrameVarDILUniquePtrDeref.py

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

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

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

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/shared_ptr/TestDataFormatterLibcxxSharedPtr.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,9 @@ def test_shared_ptr_variables(self):
9090

9191
self.expect_var_path("sp_user->id", type="int", value="30")
9292
self.expect_var_path("sp_user->name", type="std::string", summary='"steph"')
93+
94+
self.runCmd("settings set target.experimental.use-DIL true")
95+
self.expect_var_path("ptr_node->value", value="1")
96+
self.expect_var_path("ptr_node->next->value", value="2")
97+
self.expect_var_path("(*ptr_node).value", value="1")
98+
self.expect_var_path("(*(*ptr_node).next).value", value="2")

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@ struct User {
66
std::string name = "steph";
77
};
88

9+
struct NodeS {
10+
std::shared_ptr<NodeS> next;
11+
int value;
12+
};
13+
914
int main() {
1015
std::shared_ptr<int> sp_empty;
1116
std::shared_ptr<int> sp_int = std::make_shared<int>(10);
1217
std::shared_ptr<std::string> sp_str = std::make_shared<std::string>("hello");
1318
std::shared_ptr<int> &sp_int_ref = sp_int;
1419
std::shared_ptr<int> &&sp_int_ref_ref = std::make_shared<int>(10);
1520
std::shared_ptr<User> sp_user = std::make_shared<User>();
21+
std::shared_ptr<NodeS> ptr_node =
22+
std::shared_ptr<NodeS>(new NodeS{nullptr, 2});
23+
ptr_node = std::shared_ptr<NodeS>(new NodeS{std::move(ptr_node), 1});
1624

1725
return 0; // break here
1826
}

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/unique_ptr/TestDataFormatterLibcxxUniquePtr.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,9 @@ def test_unique_ptr_variables(self):
115115

116116
self.expect_var_path("up_user->id", type="int", value="30")
117117
self.expect_var_path("up_user->name", type="std::string", summary='"steph"')
118+
119+
self.runCmd("settings set target.experimental.use-DIL true")
120+
self.expect_var_path("ptr_node->value", value="1")
121+
self.expect_var_path("ptr_node->next->value", value="2")
122+
self.expect_var_path("(*ptr_node).value", value="1")
123+
self.expect_var_path("(*(*ptr_node).next).value", value="2")

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ struct User {
66
std::string name = "steph";
77
};
88

9+
struct NodeU {
10+
std::unique_ptr<NodeU> next;
11+
int value;
12+
};
13+
914
// libc++ stores unique_ptr data in a compressed pair, which has a specialized
1015
// representation when the type of the second element is an empty class. So
1116
// we need a deleter class with a dummy data member to trigger the other path.
@@ -24,6 +29,9 @@ int main() {
2429
std::unique_ptr<User> up_user = std::make_unique<User>();
2530
auto up_non_empty_deleter =
2631
std::unique_ptr<int, NonEmptyIntDeleter>(new int(1234));
32+
std::unique_ptr<NodeU> ptr_node =
33+
std::unique_ptr<NodeU>(new NodeU{nullptr, 2});
34+
ptr_node = std::unique_ptr<NodeU>(new NodeU{std::move(ptr_node), 1});
2735

2836
return 0; // break here
2937
}

0 commit comments

Comments
 (0)