1387611eaf8d8f000283bed0464597bc4e082dd7fEric Christopher// RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin %s -o - | FileCheck %s
2363e5acfd93aa62d94e02b674e753257389643b1Eric Christopher
3363e5acfd93aa62d94e02b674e753257389643b1Eric Christophertemplate<typename _CharT>
4363e5acfd93aa62d94e02b674e753257389643b1Eric Christopherstruct basic_string {
5363e5acfd93aa62d94e02b674e753257389643b1Eric Christopher
6363e5acfd93aa62d94e02b674e753257389643b1Eric Christopher  basic_string&
74b12be6a354fcad670ed440ce6c1c0583ee28186David Blaikie  assign(const _CharT* __s, const basic_string<_CharT> &x)
8363e5acfd93aa62d94e02b674e753257389643b1Eric Christopher  {
9363e5acfd93aa62d94e02b674e753257389643b1Eric Christopher    return *this;
10363e5acfd93aa62d94e02b674e753257389643b1Eric Christopher  }
11363e5acfd93aa62d94e02b674e753257389643b1Eric Christopher};
12363e5acfd93aa62d94e02b674e753257389643b1Eric Christopher
13363e5acfd93aa62d94e02b674e753257389643b1Eric Christophervoid foo (const char *c) {
14363e5acfd93aa62d94e02b674e753257389643b1Eric Christopher  basic_string<char> str;
154b12be6a354fcad670ed440ce6c1c0583ee28186David Blaikie  str.assign(c, str);
16363e5acfd93aa62d94e02b674e753257389643b1Eric Christopher}
17363e5acfd93aa62d94e02b674e753257389643b1Eric Christopher
1883369bf8f6244f20ae8bfa2fcb3a556f94da27deManman Ren// CHECK: [[BS:.*]] = {{.*}} ; [ DW_TAG_structure_type ] [basic_string<char>] [line 4, size 8, align 8, offset 0] [def] [from ]
1983369bf8f6244f20ae8bfa2fcb3a556f94da27deManman Ren// CHECK: [[TYPE:![0-9]*]] = metadata !{i32 {{.*}}, metadata [[ARGS:.*]], i32 0, null, null, null} ; [ DW_TAG_subroutine_type ]
2083369bf8f6244f20ae8bfa2fcb3a556f94da27deManman Ren// CHECK: [[ARGS]] = metadata !{metadata !{{.*}}, metadata !{{.*}}, metadata [[P:![0-9]*]], metadata [[R:.*]]}
2183369bf8f6244f20ae8bfa2fcb3a556f94da27deManman Ren// CHECK: [[P]] = {{.*}}, metadata [[CON:![0-9]*]]} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ]
228a40cc6f9cba0aaa1aac477e2b4c4605629dc587David Blaikie// CHECK: [[CON]] = {{.*}}, metadata [[CH:![0-9]*]]} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from char]
238a40cc6f9cba0aaa1aac477e2b4c4605629dc587David Blaikie// CHECK: [[CH]] = {{.*}} ; [ DW_TAG_base_type ] [char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char]
248a40cc6f9cba0aaa1aac477e2b4c4605629dc587David Blaikie
258a40cc6f9cba0aaa1aac477e2b4c4605629dc587David Blaikie// CHECK: [[R]] = {{.*}}, metadata [[CON2:![0-9]*]]} ; [ DW_TAG_reference_type ] [line 0, size 0, align 0, offset 0] [from ]
261fe3263a0df6ba164ea3922590a9e585e6737b82Manman Ren// CHECK: [[CON2]] = {{.*}}, metadata !"_ZTS12basic_stringIcE"} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from _ZTS12basic_stringIcE]
2783369bf8f6244f20ae8bfa2fcb3a556f94da27deManman Ren// CHECK: {{.*}} metadata [[TYPE]], {{.*}}, metadata !{{[0-9]*}}, metadata !{{[0-9]*}}, i32 8} ; [ DW_TAG_subprogram ] [line 7] [def] [scope 8] [assign]
28