summaryrefslogtreecommitdiff
path: root/lldb/test/API/python_api/sbvalue_synthetic
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/API/python_api/sbvalue_synthetic')
-rw-r--r--lldb/test/API/python_api/sbvalue_synthetic/Makefile3
-rw-r--r--lldb/test/API/python_api/sbvalue_synthetic/TestSBValueSynthetic.py19
-rw-r--r--lldb/test/API/python_api/sbvalue_synthetic/main.cpp11
3 files changed, 33 insertions, 0 deletions
diff --git a/lldb/test/API/python_api/sbvalue_synthetic/Makefile b/lldb/test/API/python_api/sbvalue_synthetic/Makefile
new file mode 100644
index 000000000000..99998b20bcb0
--- /dev/null
+++ b/lldb/test/API/python_api/sbvalue_synthetic/Makefile
@@ -0,0 +1,3 @@
+CXX_SOURCES := main.cpp
+
+include Makefile.rules
diff --git a/lldb/test/API/python_api/sbvalue_synthetic/TestSBValueSynthetic.py b/lldb/test/API/python_api/sbvalue_synthetic/TestSBValueSynthetic.py
new file mode 100644
index 000000000000..5dcf3c1a9c6c
--- /dev/null
+++ b/lldb/test/API/python_api/sbvalue_synthetic/TestSBValueSynthetic.py
@@ -0,0 +1,19 @@
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestSBValueSynthetic(TestBase):
+ NO_DEBUG_INFO_TESTCASE = True
+
+ def test_str(self):
+ self.build()
+ lldbutil.run_to_source_breakpoint(
+ self, "break here", lldb.SBFileSpec("main.cpp")
+ )
+
+ vector = self.frame().FindVariable("vector")
+ has_vector = self.frame().FindVariable("has_vector")
+ self.expect(str(vector), exe=False, substrs=["42", "47"])
+ self.expect(str(has_vector), exe=False, substrs=["42", "47"])
diff --git a/lldb/test/API/python_api/sbvalue_synthetic/main.cpp b/lldb/test/API/python_api/sbvalue_synthetic/main.cpp
new file mode 100644
index 000000000000..e6b6ec50f307
--- /dev/null
+++ b/lldb/test/API/python_api/sbvalue_synthetic/main.cpp
@@ -0,0 +1,11 @@
+#include <vector>
+
+struct HasVector {
+ std::vector<int> v;
+};
+
+int main() {
+ std::vector<int> vector = {42, 47};
+ HasVector has_vector = {vector};
+ return 0; // break here
+}