summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/debug-info-template-quals.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2012-08-07 00:14:25 +0000
committerEric Christopher <echristo@apple.com>2012-08-07 00:14:25 +0000
commit33becaa77aa5dea20ad0e5df1d103d6ed9543400 (patch)
tree5d4d2e38770044d5f15d3284faa3db460e2499b7 /clang/test/CodeGenCXX/debug-info-template-quals.cpp
parent34556ff0261d5bccb318234c1f49230a354ac1ea (diff)
downloadbcm5719-llvm-33becaa77aa5dea20ad0e5df1d103d6ed9543400.tar.gz
bcm5719-llvm-33becaa77aa5dea20ad0e5df1d103d6ed9543400.zip
Make sure when we get the replacement type for a template argument
that we attach the lost qualifiers. Fixes rdar://11882155 llvm-svn: 161368
Diffstat (limited to 'clang/test/CodeGenCXX/debug-info-template-quals.cpp')
-rw-r--r--clang/test/CodeGenCXX/debug-info-template-quals.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/debug-info-template-quals.cpp b/clang/test/CodeGenCXX/debug-info-template-quals.cpp
new file mode 100644
index 00000000000..ab7136bf544
--- /dev/null
+++ b/clang/test/CodeGenCXX/debug-info-template-quals.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang -emit-llvm -g -S %s -o - | FileCheck %s
+
+template<typename _CharT>
+struct basic_string {
+
+ basic_string&
+ assign(const _CharT* __s)
+ {
+ return *this;
+ }
+};
+
+void foo (const char *c) {
+ basic_string<char> str;
+ str.assign(c);
+}
+
+// CHECK: [[P:.*]] = metadata !{i32 {{.*}}, metadata [[CON:.*]]} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ]
+// CHECK: [[CON]] = metadata !{i32 {{.*}}, metadata [[CH:.*]]} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from char]
+// CHECK: [[CH]] = metadata !{i32 {{.*}}, metadata !"char", {{.*}}} ; [ DW_TAG_base_type ] [char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char]
+// CHECK: metadata !{i32 {{.*}}, metadata !"_ZN12basic_stringIcE6assignEPKc", metadata !6, i32 7, metadata [[TYPE:.*]], i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, %struct.basic_string* (%struct.basic_string*, i8*)* @_ZN12basic_stringIcE6assignEPKc, null, metadata !18, metadata !1, i32 8} ; [ DW_TAG_subprogram ] [line 7] [def] [scope 8] [assign]
+// CHECK: [[TYPE]] = metadata !{i32 {{.*}}, null, metadata [[ARGS:.*]], i32 0, i32 0}
+// CHECK: [[ARGS]] = metadata !{metadata !15, metadata !23, metadata [[P]]}
OpenPOWER on IntegriCloud