summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/cpp/template/main.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2016-06-10 20:56:09 +0000
committerGreg Clayton <gclayton@apple.com>2016-06-10 20:56:09 +0000
commit9e3ee13a1cc91152ae0c6880f1f2866c50275a10 (patch)
treeeab568d568f5b075339d5da7351cdb822a54a7ef /lldb/packages/Python/lldbsuite/test/lang/cpp/template/main.cpp
parentf2a1909bb5b7f7ee85522cff3f36c69778fdbd8f (diff)
downloadbcm5719-llvm-9e3ee13a1cc91152ae0c6880f1f2866c50275a10.tar.gz
bcm5719-llvm-9e3ee13a1cc91152ae0c6880f1f2866c50275a10.zip
Fixed C++ template integer parameter types to work correctly when the integer type is signed.
Prior to this we would display the typename for "TestObj<-1>" as "TestObj<4294967295>" when we showed the type. Expression parsing could also fail because we would fail to find the mangled name when evaluating expressions. The issue was we were losing the signed'ness of the template integer parameter in DWARFASTParserClang.cpp. <rdar://problem/25577041> llvm-svn: 272434
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/cpp/template/main.cpp')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/template/main.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/template/main.cpp b/lldb/packages/Python/lldbsuite/test/lang/cpp/template/main.cpp
new file mode 100644
index 00000000000..10a4bec62e9
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/template/main.cpp
@@ -0,0 +1,25 @@
+//===-- main.cpp ------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+template <int Arg>
+class TestObj
+{
+public:
+ int getArg()
+ {
+ return Arg;
+ }
+};
+
+int main(int argc, char **argv)
+{
+ TestObj<1> testpos;
+ TestObj<-1> testneg;
+ return testpos.getArg() - testneg.getArg(); // Breakpoint 1
+}
OpenPOWER on IntegriCloud