Douglas Katzman | 3459ce2 | 2015-10-08 04:24:12 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple x86_64-apple-darwin %s -o - | FileCheck %s |
Eric Christopher | 33becaa | 2012-08-07 00:14:25 +0000 | [diff] [blame] | 2 | |
| 3 | template<typename _CharT> |
| 4 | struct basic_string { |
| 5 | |
| 6 | basic_string& |
David Blaikie | 0549106 | 2013-01-21 04:37:12 +0000 | [diff] [blame] | 7 | assign(const _CharT* __s, const basic_string<_CharT> &x) |
Eric Christopher | 33becaa | 2012-08-07 00:14:25 +0000 | [diff] [blame] | 8 | { |
| 9 | return *this; |
| 10 | } |
| 11 | }; |
| 12 | |
| 13 | void foo (const char *c) { |
| 14 | basic_string<char> str; |
David Blaikie | 0549106 | 2013-01-21 04:37:12 +0000 | [diff] [blame] | 15 | str.assign(c, str); |
Eric Christopher | 33becaa | 2012-08-07 00:14:25 +0000 | [diff] [blame] | 16 | } |
| 17 | |
Duncan P. N. Exon Smith | 9dd4e4e | 2015-04-29 16:40:08 +0000 | [diff] [blame] | 18 | // CHECK: [[BS:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "basic_string<char>" |
Duncan P. N. Exon Smith | f04be1f | 2015-03-03 17:25:55 +0000 | [diff] [blame] | 19 | // CHECK-SAME: line: 4 |
| 20 | // CHECK-SAME: size: 8, align: 8 |
Duncan P. N. Exon Smith | 9dd4e4e | 2015-04-29 16:40:08 +0000 | [diff] [blame] | 21 | // CHECK: [[TYPE:![0-9]*]] = !DISubroutineType(types: [[ARGS:.*]]) |
Duncan P. N. Exon Smith | b3a6669 | 2014-12-15 19:10:08 +0000 | [diff] [blame] | 22 | // CHECK: [[ARGS]] = !{!{{.*}}, !{{.*}}, [[P:![0-9]*]], [[R:.*]]} |
Duncan P. N. Exon Smith | 9dd4e4e | 2015-04-29 16:40:08 +0000 | [diff] [blame] | 23 | // 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 Blaikie | 86eac72 | 2013-03-19 23:10:14 +0000 | [diff] [blame] | 26 | |
Duncan P. N. Exon Smith | 9dd4e4e | 2015-04-29 16:40:08 +0000 | [diff] [blame] | 27 | // 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 Smith | f04be1f | 2015-03-03 17:25:55 +0000 | [diff] [blame] | 30 | // CHECK-SAME: line: 7 |
| 31 | // CHECK-SAME: scopeLine: 8 |