1 // RUN: %clang_cc1 -std=c++11 -fblocks %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
2
3 // CHECK-DAG: private unnamed_addr constant [15 x i8] c"externFunction\00"
4 // CHECK-DAG: private unnamed_addr constant [26 x i8] c"void NS::externFunction()\00"
5 // CHECK-DAG: private unnamed_addr constant [49 x i8] c"void functionTemplateExplicitSpecialization(int)\00"
6
7 // CHECK-DAG: private unnamed_addr constant [95 x i8] c"void SpecializedClassTemplate<char>::memberFunctionTemplate(T, U) const [T = char, U = double]\00"
8 // CHECK-DAG: private unnamed_addr constant [85 x i8] c"void SpecializedClassTemplate<int>::memberFunctionTemplate(int, U) const [U = float]\00"
9 // CHECK-DAG: private unnamed_addr constant [57 x i8] c"void NonTypeTemplateParam<42>::size() const [Count = 42]\00"
10 // CHECK-DAG: private unnamed_addr constant [122 x i8] c"static void ClassWithTemplateTemplateParam<char, NS::ClassTemplate>::staticMember() [T = char, Param = NS::ClassTemplate]\00"
11 // CHECK-DAG: private unnamed_addr constant [106 x i8] c"void OuterClass<int *>::MiddleClass::InnerClass<float>::memberFunction(T, U) const [T = int *, U = float]\00"
12 // CHECK-DAG: private unnamed_addr constant [51 x i8] c"void functionTemplateWithCapturedStmt(T) [T = int]\00"
13 // CHECK-DAG: private unnamed_addr constant [76 x i8] c"auto functionTemplateWithLambda(int)::(anonymous class)::operator()() const\00"
14 // CHECK-DAG: private unnamed_addr constant [65 x i8] c"void functionTemplateWithUnnamedTemplateParameter(T) [T = float]\00"
15
16 // CHECK-DAG: private unnamed_addr constant [60 x i8] c"void functionTemplateExplicitSpecialization(T) [T = double]\00"
17 // CHECK-DAG: private unnamed_addr constant [52 x i8] c"T *functionTemplateWithCompoundTypes(T *) [T = int]\00"
18 // CHECK-DAG: private unnamed_addr constant [54 x i8] c"T functionTemplateWithTemplateReturnType() [T = char]\00"
19 // CHECK-DAG: private unnamed_addr constant [57 x i8] c"void functionTemplateWithoutParameterList() [T = double]\00"
20 // CHECK-DAG: private unnamed_addr constant [62 x i8] c"void functionTemplateWithTwoParams(T, U) [T = int, U = float]\00"
21
22 // CHECK-DAG: private unnamed_addr constant [22 x i8] c"classTemplateFunction\00"
23 // CHECK-DAG: private unnamed_addr constant [77 x i8] c"void NS::ClassTemplate<NS::Base *>::classTemplateFunction() [T = NS::Base *]\00"
24 // CHECK-DAG: private unnamed_addr constant [63 x i8] c"void NS::ClassTemplate<int>::classTemplateFunction() [T = int]\00"
25
26 // CHECK-DAG: private unnamed_addr constant [18 x i8] c"functionTemplate1\00"
27 // CHECK-DAG: private unnamed_addr constant [53 x i8] c"void NS::Base::functionTemplate1(T) [T = NS::Base *]\00"
28 // CHECK-DAG: private unnamed_addr constant [46 x i8] c"void NS::Base::functionTemplate1(T) [T = int]\00"
29
30 // CHECK-DAG: private unnamed_addr constant [23 x i8] c"anonymousUnionFunction\00"
31 // CHECK-DAG: private unnamed_addr constant [83 x i8] c"void NS::ContainerForAnonymousRecords::(anonymous union)::anonymousUnionFunction()\00"
32
33 // CHECK-DAG: private unnamed_addr constant [24 x i8] c"anonymousStructFunction\00"
34 // CHECK-DAG: private unnamed_addr constant [85 x i8] c"void NS::ContainerForAnonymousRecords::(anonymous struct)::anonymousStructFunction()\00"
35
36 // CHECK-DAG: private unnamed_addr constant [23 x i8] c"anonymousClassFunction\00"
37 // CHECK-DAG: private unnamed_addr constant [83 x i8] c"void NS::ContainerForAnonymousRecords::(anonymous class)::anonymousClassFunction()\00"
38
39 // CHECK-DAG: private unnamed_addr constant [12 x i8] c"~Destructor\00"
40 // CHECK-DAG: private unnamed_addr constant [30 x i8] c"NS::Destructor::~Destructor()\00"
41
42 // CHECK-DAG: private unnamed_addr constant [12 x i8] c"Constructor\00"
43 // CHECK-DAG: private unnamed_addr constant [41 x i8] c"NS::Constructor::Constructor(NS::Base *)\00"
44 // CHECK-DAG: private unnamed_addr constant [34 x i8] c"NS::Constructor::Constructor(int)\00"
45 // CHECK-DAG: private unnamed_addr constant [31 x i8] c"NS::Constructor::Constructor()\00"
46
47 // CHECK-DAG: private unnamed_addr constant [16 x i8] c"virtualFunction\00"
48 // CHECK-DAG: private unnamed_addr constant [44 x i8] c"virtual void NS::Derived::virtualFunction()\00"
49
50 // CHECK-DAG: private unnamed_addr constant [21 x i8] c"refQualifiedFunction\00"
51 // CHECK-DAG: private unnamed_addr constant [41 x i8] c"void NS::Base::refQualifiedFunction() &&\00"
52 // CHECK-DAG: private unnamed_addr constant [40 x i8] c"void NS::Base::refQualifiedFunction() &\00"
53
54 // CHECK-DAG: private unnamed_addr constant [22 x i8] c"constVolatileFunction\00"
55 // CHECK-DAG: private unnamed_addr constant [54 x i8] c"void NS::Base::constVolatileFunction() const volatile\00"
56
57 // CHECK-DAG: private unnamed_addr constant [17 x i8] c"volatileFunction\00"
58 // CHECK-DAG: private unnamed_addr constant [43 x i8] c"void NS::Base::volatileFunction() volatile\00"
59
60 // CHECK-DAG: private unnamed_addr constant [14 x i8] c"constFunction\00"
61 // CHECK-DAG: private unnamed_addr constant [37 x i8] c"void NS::Base::constFunction() const\00"
62
63 // CHECK-DAG: private unnamed_addr constant [26 x i8] c"functionReturingTemplate2\00"
64 // CHECK-DAG: private unnamed_addr constant [64 x i8] c"ClassTemplate<NS::Base *> NS::Base::functionReturingTemplate2()\00"
65
66 // CHECK-DAG: private unnamed_addr constant [26 x i8] c"functionReturingTemplate1\00"
67 // CHECK-DAG: private unnamed_addr constant [57 x i8] c"ClassTemplate<int> NS::Base::functionReturingTemplate1()\00"
68
69 // CHECK-DAG: private unnamed_addr constant [23 x i8] c"withTemplateParameter2\00"
70 // CHECK-DAG: private unnamed_addr constant [65 x i8] c"void NS::Base::withTemplateParameter2(ClassTemplate<NS::Base *>)\00"
71
72 // CHECK-DAG: private unnamed_addr constant [23 x i8] c"withTemplateParameter1\00"
73 // CHECK-DAG: private unnamed_addr constant [58 x i8] c"void NS::Base::withTemplateParameter1(ClassTemplate<int>)\00"
74
75 // CHECK-DAG: private unnamed_addr constant [23 x i8] c"functionReturningClass\00"
76 // CHECK-DAG: private unnamed_addr constant [45 x i8] c"NS::Base *NS::Base::functionReturningClass()\00"
77
78 // CHECK-DAG: private unnamed_addr constant [23 x i8] c"functionWithParameters\00"
79 // CHECK-DAG: private unnamed_addr constant [64 x i8] c"void NS::Base::functionWithParameters(int, float *, NS::Base *)\00"
80
81 // CHECK-DAG: private unnamed_addr constant [17 x i8] c"variadicFunction\00"
82 // CHECK-DAG: private unnamed_addr constant [42 x i8] c"void NS::Base::variadicFunction(int, ...)\00"
83
84 // CHECK-DAG: private unnamed_addr constant [41 x i8] c"virtual void NS::Base::virtualFunction()\00"
85
86 // CHECK-DAG: private unnamed_addr constant [15 x i8] c"inlineFunction\00"
87 // CHECK-DAG: private unnamed_addr constant [32 x i8] c"void NS::Base::inlineFunction()\00"
88
89 // CHECK-DAG: private unnamed_addr constant [15 x i8] c"staticFunction\00"
90 // CHECK-DAG: private unnamed_addr constant [39 x i8] c"static void NS::Base::staticFunction()\00"
91
92 // CHECK-DAG: private unnamed_addr constant [26 x i8] c"topLevelNamespaceFunction\00"
93 // CHECK-DAG: private unnamed_addr constant [59 x i8] c"void ClassInTopLevelNamespace::topLevelNamespaceFunction()\00"
94
95 // CHECK-DAG: private unnamed_addr constant [27 x i8] c"anonymousNamespaceFunction\00"
96 // CHECK-DAG: private unnamed_addr constant [84 x i8] c"void (anonymous namespace)::ClassInAnonymousNamespace::anonymousNamespaceFunction()\00"
97
98 // CHECK-DAG: private unnamed_addr constant [19 x i8] c"localClassFunction\00"
99 // CHECK-DAG: private unnamed_addr constant [59 x i8] c"void NS::localClass(int)::LocalClass::localClassFunction()\00"
100
101
102
103 int printf(const char * _Format, ...);
104
105 class ClassInTopLevelNamespace {
106 public:
topLevelNamespaceFunction()107 void topLevelNamespaceFunction() {
108 printf("__func__ %s\n", __func__);
109 printf("__FUNCTION__ %s\n", __FUNCTION__);
110 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
111 }
112 };
113
114 namespace {
115
116 class ClassInAnonymousNamespace {
117 public:
anonymousNamespaceFunction()118 void anonymousNamespaceFunction() {
119 printf("__func__ %s\n", __func__);
120 printf("__FUNCTION__ %s\n", __FUNCTION__);
121 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
122 }
123 };
124
125 } // end anonymous namespace
126
127 namespace NS {
128
129 template<typename T>
130 class ClassTemplate {
131 public:
classTemplateFunction()132 void classTemplateFunction() {
133 printf("__func__ %s\n", __func__);
134 printf("__FUNCTION__ %s\n", __FUNCTION__);
135 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
136 }
137 };
138
139 class Base {
140 public:
staticFunction()141 static void staticFunction() {
142 printf("__func__ %s\n", __func__);
143 printf("__FUNCTION__ %s\n", __FUNCTION__);
144 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
145 }
146
147 inline void (inlineFunction)() {
148 printf("__func__ %s\n", __func__);
149 printf("__FUNCTION__ %s\n", __FUNCTION__);
150 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
151 }
152
virtualFunction()153 virtual void virtualFunction() {
154 printf("__func__ %s\n", __func__);
155 printf("__FUNCTION__ %s\n", __FUNCTION__);
156 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
157 }
158
functionWithParameters(int,float *,Base * base)159 void functionWithParameters(int, float*, Base* base) {
160 printf("__func__ %s\n", __func__);
161 printf("__FUNCTION__ %s\n", __FUNCTION__);
162 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
163 }
164
functionReturningClass()165 Base *functionReturningClass() {
166 printf("__func__ %s\n", __func__);
167 printf("__FUNCTION__ %s\n", __FUNCTION__);
168 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
169 return 0;
170 }
171
variadicFunction(int,...)172 void variadicFunction(int, ...) {
173 printf("__func__ %s\n", __func__);
174 printf("__FUNCTION__ %s\n", __FUNCTION__);
175 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
176 }
177
withTemplateParameter1(ClassTemplate<int>)178 void withTemplateParameter1(ClassTemplate<int>) {
179 printf("__func__ %s\n", __func__);
180 printf("__FUNCTION__ %s\n", __FUNCTION__);
181 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
182 }
183
withTemplateParameter2(ClassTemplate<Base * >)184 void withTemplateParameter2(ClassTemplate<Base *>) {
185 printf("__func__ %s\n", __func__);
186 printf("__FUNCTION__ %s\n", __FUNCTION__);
187 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
188 }
189
functionReturingTemplate1()190 ClassTemplate<int> functionReturingTemplate1() {
191 printf("__func__ %s\n", __func__);
192 printf("__FUNCTION__ %s\n", __FUNCTION__);
193 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
194 return ClassTemplate<int>();
195 }
196
functionReturingTemplate2()197 ClassTemplate<Base *> functionReturingTemplate2() {
198 printf("__func__ %s\n", __func__);
199 printf("__FUNCTION__ %s\n", __FUNCTION__);
200 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
201 return ClassTemplate<Base *>();
202 }
203
204 template<typename T>
functionTemplate1(T t)205 void functionTemplate1(T t) {
206 printf("__func__ %s\n", __func__);
207 printf("__FUNCTION__ %s\n", __FUNCTION__);
208 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
209 }
210
constFunction() const211 void constFunction() const {
212 printf("__func__ %s\n", __func__);
213 printf("__FUNCTION__ %s\n", __FUNCTION__);
214 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
215 }
216
volatileFunction()217 void volatileFunction() volatile {
218 printf("__func__ %s\n", __func__);
219 printf("__FUNCTION__ %s\n", __FUNCTION__);
220 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
221 }
222
constVolatileFunction() const223 void constVolatileFunction() const volatile {
224 printf("__func__ %s\n", __func__);
225 printf("__FUNCTION__ %s\n", __FUNCTION__);
226 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
227 }
228
refQualifiedFunction()229 void refQualifiedFunction() & {
230 printf("__func__ %s\n", __func__);
231 printf("__FUNCTION__ %s\n", __FUNCTION__);
232 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
233 }
234
refQualifiedFunction()235 void refQualifiedFunction() && {
236 printf("__func__ %s\n", __func__);
237 printf("__FUNCTION__ %s\n", __FUNCTION__);
238 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
239 }
240 };
241
242 class Derived : public Base {
243 public:
244 // Virtual function without being explicitly written.
virtualFunction()245 void virtualFunction() {
246 printf("__func__ %s\n", __func__);
247 printf("__FUNCTION__ %s\n", __FUNCTION__);
248 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
249 }
250 };
251
252 class Constructor {
253 public:
Constructor()254 Constructor() {
255 printf("__func__ %s\n", __func__);
256 printf("__FUNCTION__ %s\n", __FUNCTION__);
257 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
258 }
259
Constructor(int)260 Constructor(int) {
261 printf("__func__ %s\n", __func__);
262 printf("__FUNCTION__ %s\n", __FUNCTION__);
263 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
264 }
265
Constructor(Base *)266 Constructor(Base *) {
267 printf("__func__ %s\n", __func__);
268 printf("__FUNCTION__ %s\n", __FUNCTION__);
269 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
270 }
271 };
272
273 class Destructor {
274 public:
~Destructor()275 ~Destructor() {
276 printf("__func__ %s\n", __func__);
277 printf("__FUNCTION__ %s\n", __FUNCTION__);
278 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
279 }
280 };
281
282 class ContainerForAnonymousRecords {
283 public:
284 class {
285 public:
anonymousClassFunction()286 void anonymousClassFunction() {
287 printf("__func__ %s\n", __func__);
288 printf("__FUNCTION__ %s\n", __FUNCTION__);
289 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
290 }
291 } anonymousClass;
292
293 struct {
anonymousStructFunctionNS::ContainerForAnonymousRecords::__anonfe37c7fe0308294 void anonymousStructFunction() {
295 printf("__func__ %s\n", __func__);
296 printf("__FUNCTION__ %s\n", __FUNCTION__);
297 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
298 }
299 } anonymousStruct;
300
301 union {
anonymousUnionFunction()302 void anonymousUnionFunction() {
303 printf("__func__ %s\n", __func__);
304 printf("__FUNCTION__ %s\n", __FUNCTION__);
305 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
306 }
307 } anonymousUnion;
308 };
309
localClass(int)310 void localClass(int) {
311 class LocalClass {
312 public:
313 void localClassFunction() {
314 printf("__func__ %s\n", __func__);
315 printf("__FUNCTION__ %s\n", __FUNCTION__);
316 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
317 }
318 };
319 LocalClass lc;
320 lc.localClassFunction();
321 }
322
externFunction()323 extern void externFunction() {
324 printf("__func__ %s\n", __func__);
325 printf("__FUNCTION__ %s\n", __FUNCTION__);
326 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
327 }
328
329 } // end NS namespace
330
331 // additional tests for __PRETTY_FUNCTION__
332 template <typename T, typename U>
functionTemplateWithTwoParams(T,U)333 void functionTemplateWithTwoParams(T, U)
334 {
335 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
336 }
337
338 template <typename T>
functionTemplateWithoutParameterList()339 void functionTemplateWithoutParameterList()
340 {
341 T t = T();
342
343 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
344 }
345
346 template <typename T>
functionTemplateWithTemplateReturnType()347 T functionTemplateWithTemplateReturnType()
348 {
349 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
350
351 return T();
352 }
353
354 template <typename T>
functionTemplateWithCompoundTypes(T a[])355 T * functionTemplateWithCompoundTypes(T a[])
356 {
357 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
358
359 return 0;
360 }
361
362 template <typename T>
functionTemplateExplicitSpecialization(T t)363 void functionTemplateExplicitSpecialization(T t)
364 {
365 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
366 }
367
368 template <>
functionTemplateExplicitSpecialization(int i)369 void functionTemplateExplicitSpecialization<int>(int i)
370 {
371 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
372 }
373
374 template <typename, typename T>
functionTemplateWithUnnamedTemplateParameter(T t)375 void functionTemplateWithUnnamedTemplateParameter(T t)
376 {
377 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
378 }
379
380 template <typename T>
functionTemplateWithLambda(T t)381 void functionTemplateWithLambda(T t)
382 {
383 []() {
384 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
385 } ();
386 }
387
388 template <typename T>
functionTemplateWithCapturedStmt(T t)389 void functionTemplateWithCapturedStmt(T t)
390 {
391 #pragma clang __debug captured
392 {
393 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
394 }
395 }
396
397 template <typename T>
398 class OuterClass
399 {
400 public:
401 class MiddleClass
402 {
403 public:
404 template <typename U>
405 class InnerClass
406 {
407 public:
memberFunction(T x,U y) const408 void memberFunction(T x, U y) const
409 {
410 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
411 }
412 };
413 };
414 };
415
416 template <typename T, template <typename> class Param = NS::ClassTemplate>
417 class ClassWithTemplateTemplateParam
418 {
419 public:
staticMember()420 static void staticMember()
421 {
422 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
423 }
424 };
425
426 template <int Count>
427 class NonTypeTemplateParam
428 {
429 public:
size() const430 void size() const
431 {
432 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
433 }
434 };
435
436 template <typename T>
437 class SpecializedClassTemplate
438 {
439 public:
440 template <typename U>
memberFunctionTemplate(T t,U u) const441 void memberFunctionTemplate(T t, U u) const
442 {
443 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
444 }
445 };
446
447 template <>
448 class SpecializedClassTemplate<int>
449 {
450 public:
451 template <typename U>
memberFunctionTemplate(int i,U u) const452 void memberFunctionTemplate(int i, U u) const
453 {
454 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
455 }
456 };
457
main()458 int main() {
459 ClassInAnonymousNamespace anonymousNamespace;
460 anonymousNamespace.anonymousNamespaceFunction();
461
462 ClassInTopLevelNamespace topLevelNamespace;
463 topLevelNamespace.topLevelNamespaceFunction();
464
465 NS::Base::staticFunction();
466
467 NS::Base b;
468 b.inlineFunction();
469 b.virtualFunction();
470 b.variadicFunction(0);
471 b.functionWithParameters(0, 0, 0);
472 b.functionReturningClass();
473
474 b.withTemplateParameter1(NS::ClassTemplate<int>());
475 b.withTemplateParameter2(NS::ClassTemplate<NS::Base *>());
476 b.functionReturingTemplate1();
477 b.functionReturingTemplate2();
478 b.functionTemplate1<int>(0);
479 b.functionTemplate1<NS::Base *>(0);
480 b.constFunction();
481 b.volatileFunction();
482 b.constVolatileFunction();
483 b.refQualifiedFunction();
484 NS::Base().refQualifiedFunction();
485
486 NS::Derived d;
487 d.virtualFunction();
488
489 NS::ClassTemplate<int> t1;
490 t1.classTemplateFunction();
491 NS::ClassTemplate<NS::Base *> t2;
492 t2.classTemplateFunction();
493
494 NS::Constructor c1;
495 NS::Constructor c2(0);
496 NS::Constructor c3((NS::Base *)0);
497
498 {
499 NS::Destructor destructor;
500 }
501
502 NS::ContainerForAnonymousRecords anonymous;
503 anonymous.anonymousClass.anonymousClassFunction();
504 anonymous.anonymousStruct.anonymousStructFunction();
505 anonymous.anonymousUnion.anonymousUnionFunction();
506
507 NS::localClass(0);
508
509 NS::externFunction();
510
511 // additional tests for __PRETTY_FUNCTION__
512
513 functionTemplateWithTwoParams(0, 0.0f);
514 functionTemplateWithoutParameterList<double>();
515 functionTemplateWithTemplateReturnType<char>();
516 int array[] = { 1, 2, 3 };
517 functionTemplateWithCompoundTypes(array);
518 functionTemplateExplicitSpecialization(0);
519 functionTemplateExplicitSpecialization(0.0);
520 functionTemplateWithUnnamedTemplateParameter<int, float>(0.0f);
521
522 functionTemplateWithLambda<int>(0);
523 functionTemplateWithCapturedStmt<int>(0);
524
525 OuterClass<int *>::MiddleClass::InnerClass<float> omi;
526 omi.memberFunction(0, 0.0f);
527
528 ClassWithTemplateTemplateParam<char>::staticMember();
529
530 NonTypeTemplateParam<42> ntt;
531 ntt.size();
532
533 SpecializedClassTemplate<int> sct1;
534 sct1.memberFunctionTemplate(0, 0.0f);
535 SpecializedClassTemplate<char> sct2;
536 sct2.memberFunctionTemplate('0', 0.0);
537
538 return 0;
539 }
540
541 // rdar://19065361
542 class XXX {
543 XXX();
544 ~XXX();
545 };
546
XXLog(const char * functionName)547 void XXLog(const char *functionName) { }
548
549 typedef void (^notify_handler_t)(int token);
550
551 typedef void (^dispatch_block_t)(void);
552
553 void notify_register_dispatch(notify_handler_t handler);
554
555 void _dispatch_once(dispatch_block_t block);
556
XXX()557 XXX::XXX()
558 {
559 _dispatch_once(^{ notify_register_dispatch( ^(int token) { XXLog(__FUNCTION__); });
560 });
561 }
562 // CHECK: define internal {{.*}}void @___ZN3XXXC2Ev_block_invoke_
563
~XXX()564 XXX::~XXX()
565 {
566 _dispatch_once(^{ notify_register_dispatch( ^(int token) { XXLog(__FUNCTION__); });
567 });
568 }
569 // CHECK: define internal {{.*}}void @___ZN3XXXD2Ev_block_invoke_
570