diff options
author | Pavel Labath <labath@google.com> | 2017-11-01 15:19:52 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2017-11-01 15:19:52 +0000 |
commit | 333739d0e22acfbc354588cf49e783063aabe96a (patch) | |
tree | 8eac1a56e540d66e275f989c64af570e960ad81a /lldb/packages/Python/lldbsuite/test | |
parent | eed6531ea2a3152149552fc0e29cf3f0d91f47dc (diff) | |
download | bcm5719-llvm-333739d0e22acfbc354588cf49e783063aabe96a.tar.gz bcm5719-llvm-333739d0e22acfbc354588cf49e783063aabe96a.zip |
Add data formatter for libc++ std::tuple
Reviewers: jingham, EricWF
Subscribers: srhines, eugene, lldb-commits, mgorny
Differential Revision: https://reviews.llvm.org/D35615
llvm-svn: 317095
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
3 files changed, 68 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/Makefile b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/Makefile new file mode 100644 index 00000000000..bf75013f531 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/Makefile @@ -0,0 +1,6 @@ +LEVEL = ../../../../../make + +CXX_SOURCES := main.cpp + +USE_LIBCPP := 1 +include $(LEVEL)/Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py new file mode 100644 index 00000000000..b25540056a2 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py @@ -0,0 +1,51 @@ +""" +Test lldb data formatter subsystem. +""" + +from __future__ import print_function + + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestDataFormatterLibcxxTuple(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + def setUp(self): + TestBase.setUp(self) + self.line = line_number('main.cpp', '// break here') + ns = 'ndk' if lldbplatformutil.target_is_android() else '' + self.namespace = 'std::__' + ns + '1' + + @add_test_categories(["libc++"]) + def test(self): + """Test that std::tuple is displayed correctly""" + self.build() + lldbutil.run_to_source_breakpoint(self, '// break here', + lldb.SBFileSpec("main.cpp", False)) + + tuple_name = self.namespace + '::tuple' + self.expect("frame variable empty", + substrs=[tuple_name, + 'size=0', + '{}']) + + self.expect("frame variable one_elt", + substrs=[tuple_name, + 'size=1', + '{', + '[0] = 47', + '}']) + + self.expect("frame variable three_elts", + substrs=[tuple_name, + 'size=3', + '{', + '[0] = 1', + '[1] = 47', + '[2] = "foo"', + '}']) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp new file mode 100644 index 00000000000..1c0d0f2ae77 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp @@ -0,0 +1,11 @@ +#include <tuple> +#include <string> + +using namespace std; + +int main() { + tuple<> empty; + tuple<int> one_elt{47}; + tuple<int, long, string> three_elts{1, 47l, "foo"}; + return 0; // break here +} |