blob: cfee78d974936f70ecc425863ae92fc6e2250dfe [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 Smith383f8412016-04-23 21:08:27 +000018// CHECK: [[P:![0-9]*]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: [[CON:![0-9]*]]
19// CHECK: [[CON]] = !DIDerivedType(tag: DW_TAG_const_type, baseType: [[CH:![0-9]*]]
Victor Leschuka7ece032016-10-20 00:13:19 +000020// CHECK: [[CH]] = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
Duncan P. N. Exon Smithf9521b02016-04-17 07:45:08 +000021// CHECK: [[BS:.*]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "basic_string<char>"
Duncan P. N. Exon Smithf04be1f2015-03-03 17:25:55 +000022// CHECK-SAME: line: 4
Victor Leschuka7ece032016-10-20 00:13:19 +000023// CHECK-SAME: size: 8
Duncan P. N. Exon Smith9dd4e4e2015-04-29 16:40:08 +000024// CHECK: [[TYPE:![0-9]*]] = !DISubroutineType(types: [[ARGS:.*]])
Duncan P. N. Exon Smith383f8412016-04-23 21:08:27 +000025// CHECK: [[ARGS]] = !{!{{.*}}, !{{.*}}, [[P]], [[R:.*]]}
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]*]]
Duncan P. N. Exon Smith383f8412016-04-23 21:08:27 +000028// CHECK: [[CON2]] = !DIDerivedType(tag: DW_TAG_const_type, baseType: [[BS]]
Duncan P. N. Exon Smith9dd4e4e2015-04-29 16:40:08 +000029// CHECK: !DISubprogram(name: "assign"
Duncan P. N. Exon Smithf04be1f2015-03-03 17:25:55 +000030// CHECK-SAME: line: 7
31// CHECK-SAME: scopeLine: 8