Eric Christopher | 387611e | 2012-08-07 05:04:19 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin %s -o - | FileCheck %s |
Eric Christopher | 363e5ac | 2012-08-07 00:14:25 +0000 | [diff] [blame] | 2 | |
| 3 | template<typename _CharT> |
| 4 | struct basic_string { |
| 5 | |
| 6 | basic_string& |
David Blaikie | 4b12be6 | 2013-01-21 04:37:12 +0000 | [diff] [blame] | 7 | assign(const _CharT* __s, const basic_string<_CharT> &x) |
Eric Christopher | 363e5ac | 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 | 4b12be6 | 2013-01-21 04:37:12 +0000 | [diff] [blame] | 15 | str.assign(c, str); |
Eric Christopher | 363e5ac | 2012-08-07 00:14:25 +0000 | [diff] [blame] | 16 | } |
| 17 | |
David Blaikie | 8a40cc6 | 2013-03-19 23:10:14 +0000 | [diff] [blame] | 18 | // CHECK: [[P:.*]] = {{.*}}, metadata [[CON:![0-9]*]]} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ] |
| 19 | // CHECK: [[CON]] = {{.*}}, metadata [[CH:![0-9]*]]} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from char] |
| 20 | // CHECK: [[CH]] = {{.*}} ; [ DW_TAG_base_type ] [char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char] |
| 21 | |
| 22 | // CHECK: {{.*}} metadata [[TYPE:![0-9]*]], {{.*}}, metadata !{{[0-9]*}}, metadata !{{[0-9]*}}, i32 8} ; [ DW_TAG_subprogram ] [line 7] [def] [scope 8] [assign] |
| 23 | // CHECK: [[TYPE]] = metadata !{i32 {{.*}}, metadata [[ARGS:.*]], i32 0, i32 0} ; [ DW_TAG_subroutine_type ] |
David Blaikie | 083b90d | 2013-02-02 00:34:26 +0000 | [diff] [blame] | 24 | // CHECK: [[ARGS]] = metadata !{metadata !{{.*}}, metadata !{{.*}}, metadata [[P]], metadata [[R:.*]]} |
David Blaikie | 8a40cc6 | 2013-03-19 23:10:14 +0000 | [diff] [blame] | 25 | // CHECK: [[BS:.*]] = {{.*}} ; [ DW_TAG_structure_type ] [basic_string<char>] [line 4, size 8, align 8, offset 0] [from ] |
| 26 | // CHECK: [[R]] = {{.*}}, metadata [[CON2:![0-9]*]]} ; [ DW_TAG_reference_type ] [line 0, size 0, align 0, offset 0] [from ] |
| 27 | // CHECK: [[CON2]] = {{.*}}, metadata [[BS]]} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from basic_string<char>] |