blob: 1e8bdb1ad714563edf7d12c58bbea9a14389d546 [file] [log] [blame]
Douglas Katzman3459ce22015-10-08 04:24:12 +00001// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple x86_64-apple-darwin %s -o - | FileCheck %s
Eric Christopher33becaa2012-08-07 00:14:25 +00002
3template<typename _CharT>
4struct basic_string {
5
6 basic_string&
David Blaikie05491062013-01-21 04:37:12 +00007 assign(const _CharT* __s, const basic_string<_CharT> &x)
Eric Christopher33becaa2012-08-07 00:14:25 +00008 {
9 return *this;
10 }
11};
12
13void foo (const char *c) {
14 basic_string<char> str;
David Blaikie05491062013-01-21 04:37:12 +000015 str.assign(c, str);
Eric Christopher33becaa2012-08-07 00:14:25 +000016}
17
Duncan P. N. Exon Smith9dd4e4e2015-04-29 16:40:08 +000018// CHECK: [[BS:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "basic_string<char>"
Duncan P. N. Exon Smithf04be1f2015-03-03 17:25:55 +000019// CHECK-SAME: line: 4
20// CHECK-SAME: size: 8, align: 8
Duncan P. N. Exon Smith9dd4e4e2015-04-29 16:40:08 +000021// CHECK: [[TYPE:![0-9]*]] = !DISubroutineType(types: [[ARGS:.*]])
Duncan P. N. Exon Smithb3a66692014-12-15 19:10:08 +000022// CHECK: [[ARGS]] = !{!{{.*}}, !{{.*}}, [[P:![0-9]*]], [[R:.*]]}
Duncan P. N. Exon Smith9dd4e4e2015-04-29 16:40:08 +000023// CHECK: [[P]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: [[CON:![0-9]*]]
24// CHECK: [[CON]] = !DIDerivedType(tag: DW_TAG_const_type, baseType: [[CH:![0-9]*]]
25// CHECK: [[CH]] = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
David Blaikie86eac722013-03-19 23:10:14 +000026
Duncan P. N. Exon Smith9dd4e4e2015-04-29 16:40:08 +000027// CHECK: [[R]] = !DIDerivedType(tag: DW_TAG_reference_type, baseType: [[CON2:![0-9]*]]
28// CHECK: [[CON2]] = !DIDerivedType(tag: DW_TAG_const_type, baseType: !"_ZTS12basic_stringIcE"
29// CHECK: !DISubprogram(name: "assign"
Duncan P. N. Exon Smithf04be1f2015-03-03 17:25:55 +000030// CHECK-SAME: line: 7
31// CHECK-SAME: scopeLine: 8