summaryrefslogtreecommitdiffstats
path: root/packages/Python/lldbsuite/test/lang/cpp/auto
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Python/lldbsuite/test/lang/cpp/auto')
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/auto/Makefile7
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/auto/TestCPPAuto.py25
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/auto/main.cpp16
3 files changed, 48 insertions, 0 deletions
diff --git a/packages/Python/lldbsuite/test/lang/cpp/auto/Makefile b/packages/Python/lldbsuite/test/lang/cpp/auto/Makefile
new file mode 100644
index 0000000..194af7b
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/auto/Makefile
@@ -0,0 +1,7 @@
+LEVEL = ../../../make
+
+CXX_SOURCES := main.cpp
+
+CFLAGS_EXTRAS += $(NO_LIMIT_DEBUG_INFO_FLAGS)
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/lang/cpp/auto/TestCPPAuto.py b/packages/Python/lldbsuite/test/lang/cpp/auto/TestCPPAuto.py
new file mode 100644
index 0000000..9746dec
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/auto/TestCPPAuto.py
@@ -0,0 +1,25 @@
+"""
+Tests that auto types work
+"""
+import lldb
+from lldbsuite.test.lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+
+class CPPAutoTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ @expectedFailureGcc("GCC does not generate complete debug info")
+ def test_with_run_command(self):
+ """Test that auto types work in the expression parser"""
+ self.build()
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ line = line_number('main.cpp', '// break here')
+ lldbutil.run_break_set_by_file_and_line (self, "main.cpp", line, num_expected_locations=-1, loc_exact=False)
+
+ self.runCmd("process launch", RUN_SUCCEEDED)
+
+ self.expect('expr auto f = 123456; f', substrs=['int', '123456'])
+ self.expect('expr struct Test { int x; int y; Test() : x(123), y(456) {} }; auto t = Test(); t', substrs=['Test', '123', '456'])
+ self.expect('expr auto s = helloworld; s', substrs=['string', 'hello world'])
diff --git a/packages/Python/lldbsuite/test/lang/cpp/auto/main.cpp b/packages/Python/lldbsuite/test/lang/cpp/auto/main.cpp
new file mode 100644
index 0000000..76fb95e
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/auto/main.cpp
@@ -0,0 +1,16 @@
+//===-- main.cpp ------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <string>
+
+int main()
+{
+ std::string helloworld("hello world");
+ return 0; // break here
+}
OpenPOWER on IntegriCloud