Home | History | Annotate | Download | only in CodeGenCXX
      1 // RUN: %clang_cc1 -fblocks -debug-info-kind=limited -gcodeview -emit-llvm %s -o - -triple=x86_64-pc-win32 -std=c++98 | \
      2 // RUN:  grep 'DISubprogram' | sed -e 's/.*name: "\([^"]*\)".*/"\1"/' | FileCheck %s
      3 
      4 void freefunc() { }
      5 // CHECK-DAG: "freefunc"
      6 
      7 namespace N {
      8   int b() { return 0; }
      9 // CHECK-DAG: "N::b"
     10   namespace { void func() { } }
     11 // CHECK-DAG: "N::`anonymous namespace'::func
     12 }
     13 
     14 void _c(void) {
     15   N::func();
     16 }
     17 // CHECK-DAG: "_c"
     18 
     19 struct foo {
     20   int operator+(int);
     21   foo(){}
     22 // CHECK-DAG: "foo::foo"
     23 
     24   ~foo(){}
     25 // CHECK-DAG: "foo::~foo"
     26 
     27   foo(int i){}
     28 // CHECK-DAG: "foo::foo"
     29 
     30   foo(char *q){}
     31 // CHECK-DAG: "foo::foo"
     32 
     33   static foo* static_method() { return 0; }
     34 // CHECK-DAG: "foo::static_method"
     35 
     36 };
     37 
     38 void use_foo() {
     39   foo f1, f2(1), f3((char*)0);
     40   foo::static_method();
     41 }
     42 
     43 // CHECK-DAG: "foo::operator+"
     44 int foo::operator+(int a) { return a; }
     45 
     46 // PR17371
     47 struct OverloadedNewDelete {
     48   // __cdecl
     49   void *operator new(__SIZE_TYPE__);
     50   void *operator new[](__SIZE_TYPE__);
     51   void operator delete(void *);
     52   void operator delete[](void *);
     53   // __thiscall
     54   int operator+(int);
     55 };
     56 
     57 void *OverloadedNewDelete::operator new(__SIZE_TYPE__ s) { return 0; }
     58 void *OverloadedNewDelete::operator new[](__SIZE_TYPE__ s) { return 0; }
     59 void OverloadedNewDelete::operator delete(void *) { }
     60 void OverloadedNewDelete::operator delete[](void *) { }
     61 int OverloadedNewDelete::operator+(int x) { return x; };
     62 
     63 // CHECK-DAG: "OverloadedNewDelete::operator new"
     64 // CHECK-DAG: "OverloadedNewDelete::operator new[]"
     65 // CHECK-DAG: "OverloadedNewDelete::operator delete"
     66 // CHECK-DAG: "OverloadedNewDelete::operator delete[]"
     67 // CHECK-DAG: "OverloadedNewDelete::operator+"
     68 
     69 template <void (*)(void)>
     70 void fn_tmpl() {}
     71 
     72 template void fn_tmpl<freefunc>();
     73 // CHECK-DAG: "fn_tmpl"
     74