1 // RUN: %clang_cc1 -fblocks -debug-info-kind=limited -gcodeview -emit-llvm %s \
2 // RUN: -o - -triple=x86_64-pc-win32 -Wno-new-returns-null -std=c++98 | \
3 // RUN: grep -E 'DISubprogram|DICompositeType' | sed -e 's/.*name: "\(ptr\)".*/"\1"/' | \
4 // RUN: FileCheck %s --check-prefixes=CHECK,UNQUAL
5 // RUN: %clang_cc1 -fblocks -debug-info-kind=line-tables-only -gcodeview -emit-llvm %s \
6 // RUN: -o - -triple=x86_64-pc-win32 -Wno-new-returns-null -std=c++98 | \
7 // RUN: grep 'DISubprogram' | sed -e 's/.*name: "\(ptr\)".*/"\1"/' | \
9 // RUN: %clang_cc1 -fblocks -debug-info-kind=limited -gcodeview -emit-llvm %s \
10 // RUN: -o - -triple=x86_64-pc-win32 -Wno-new-returns-null -std=c++11 | \
11 // RUN: grep -E 'DISubprogram|DICompositeType' | sed -e 's/.*name: "\(ptr\)".*/"\1"/' | \
12 // RUN: FileCheck %s --check-prefixes=CHECK,UNQUAL
13 // RUN: %clang_cc1 -fblocks -debug-info-kind=limited -gcodeview -emit-llvm %s \
14 // RUN: -o - -triple=x86_64-pc-win32 -Wno-new-returns-null | \
15 // RUN: grep -E 'DISubprogram|DICompositeType' | sed -e 's/.*name: "\(ptr\)".*/"\1"/' | \
16 // RUN: FileCheck %s --check-prefixes=CHECK,UNQUAL
19 // CHECK-DAG: "freefunc"
24 namespace { void func() { } }
47 static foo
* static_method() { return 0; }
48 // CHECK-DAG: "static_method"
53 foo f1
, f2(1), f3((char*)0);
57 // CHECK-DAG: "operator+"
58 int foo::operator+(int a
) { return a
; }
61 struct OverloadedNewDelete
{
63 void *operator new(__SIZE_TYPE__
);
64 void *operator new[](__SIZE_TYPE__
);
65 void operator delete(void *);
66 void operator delete[](void *);
71 void *OverloadedNewDelete::operator new(__SIZE_TYPE__ s
) { return 0; }
72 void *OverloadedNewDelete::operator new[](__SIZE_TYPE__ s
) { return 0; }
73 void OverloadedNewDelete::operator delete(void *) { }
74 void OverloadedNewDelete::operator delete[](void *) { }
75 int OverloadedNewDelete::operator+(int x
) { return x
; };
77 // CHECK-DAG: "operator new"
78 // CHECK-DAG: "operator new[]"
79 // CHECK-DAG: "operator delete"
80 // CHECK-DAG: "operator delete[]"
81 // CHECK-DAG: "operator+"
83 template <typename T
, void (*)(void)>
86 template void fn_tmpl
<int, freefunc
>();
87 // CHECK-DAG: "fn_tmpl<int,&freefunc>"
89 template <typename T
, void (*)(void)>
90 void fn_tmpl_typecheck() {}
92 template void fn_tmpl_typecheck
<int, &freefunc
>();
93 // CHECK-DAG: "fn_tmpl_typecheck<int,&freefunc>"
95 template <typename A
, typename B
, typename C
> struct ClassTemplate
{ A a
; B b
; C c
; };
96 ClassTemplate
<char, short, ClassTemplate
<int, int, int> > f
;
97 // This will only show up in normal debug builds. The space in `> >` is
98 // important for compatibility with Windows debuggers, so it should always be
99 // there when generating CodeView.
100 // UNQUAL-DAG: "ClassTemplate<char,short,ClassTemplate<int,int,int> >"