blob: 2d30e8f1c10b1f793d8331f8951f4c59bedefbfc [file] [log] [blame]
Eric Christopher96b5f072012-08-07 05:04:19 +00001// RUN: %clang_cc1 -emit-llvm -g -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
Manman Rene0064d82013-08-29 23:19:58 +000018// CHECK: [[BS:.*]] = {{.*}} ; [ DW_TAG_structure_type ] [basic_string<char>] [line 4, size 8, align 8, offset 0] [def] [from ]
19// CHECK: [[TYPE:![0-9]*]] = metadata !{i32 {{.*}}, metadata [[ARGS:.*]], i32 0, null, null, null} ; [ DW_TAG_subroutine_type ]
20// CHECK: [[ARGS]] = metadata !{metadata !{{.*}}, metadata !{{.*}}, metadata [[P:![0-9]*]], metadata [[R:.*]]}
21// CHECK: [[P]] = {{.*}}, metadata [[CON:![0-9]*]]} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ]
David Blaikie86eac722013-03-19 23:10:14 +000022// CHECK: [[CON]] = {{.*}}, metadata [[CH:![0-9]*]]} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from char]
23// CHECK: [[CH]] = {{.*}} ; [ DW_TAG_base_type ] [char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char]
24
David Blaikie86eac722013-03-19 23:10:14 +000025// CHECK: [[R]] = {{.*}}, metadata [[CON2:![0-9]*]]} ; [ DW_TAG_reference_type ] [line 0, size 0, align 0, offset 0] [from ]
26// CHECK: [[CON2]] = {{.*}}, metadata [[BS]]} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from basic_string<char>]
Manman Rene0064d82013-08-29 23:19:58 +000027// CHECK: {{.*}} metadata [[TYPE]], {{.*}}, metadata !{{[0-9]*}}, metadata !{{[0-9]*}}, i32 8} ; [ DW_TAG_subprogram ] [line 7] [def] [scope 8] [assign]