Home | History | Annotate | Download | only in CodeGenCXX
      1 // RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple x86_64-apple-darwin %s -o - | FileCheck %s
      2 
      3 template<typename _CharT>
      4 struct basic_string {
      5 
      6   basic_string&
      7   assign(const _CharT* __s, const basic_string<_CharT> &x)
      8   {
      9     return *this;
     10   }
     11 };
     12 
     13 void foo (const char *c) {
     14   basic_string<char> str;
     15   str.assign(c, str);
     16 }
     17 
     18 // 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]*]]
     20 // CHECK: [[CH]] = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
     21 // CHECK: [[BS:.*]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "basic_string<char>"
     22 // CHECK-SAME:                         line: 4
     23 // CHECK-SAME:                         size: 8, align: 8
     24 // CHECK: [[TYPE:![0-9]*]] = !DISubroutineType(types: [[ARGS:.*]])
     25 // CHECK: [[ARGS]] = !{!{{.*}}, !{{.*}}, [[P]], [[R:.*]]}
     26 
     27 // CHECK: [[R]] = !DIDerivedType(tag: DW_TAG_reference_type, baseType: [[CON2:![0-9]*]]
     28 // CHECK: [[CON2]] = !DIDerivedType(tag: DW_TAG_const_type, baseType: [[BS]]
     29 // CHECK: !DISubprogram(name: "assign"
     30 // CHECK-SAME:          line: 7
     31 // CHECK-SAME:          scopeLine: 8
     32