1 // RUN: %clang_cc1 -std=c++14 %s -triple %itanium_abi_triple -fblocks -emit-llvm -o - | FileCheck %s
2 // RUN: %clang_cc1 -x c++ -std=c++14 -triple %itanium_abi_triple -fblocks -emit-pch -o %t %s
3 // RUN: %clang_cc1 -x c++ -triple %itanium_abi_triple -std=c++14 -fblocks -include-pch %t %s -emit-llvm -o - | FileCheck %s
8 // CHECK-DAG: @__func__._ZN13ClassTemplateIiE21classTemplateFunctionERi = private unnamed_addr constant [22 x i8] c"classTemplateFunction\00"
9 // CHECK-DAG: @__PRETTY_FUNCTION__._ZN13ClassTemplateIiE21classTemplateFunctionERi = private unnamed_addr constant [69 x i8] c"const auto &ClassTemplate<int>::classTemplateFunction(T &) [T = int]\00"
11 // CHECK-DAG: @__func__._ZN24ClassInTopLevelNamespace16functionTemplateIiEERDaRT_ = private unnamed_addr constant [17 x i8] c"functionTemplate\00"
12 // CHECK-DAG: @__PRETTY_FUNCTION__._ZN24ClassInTopLevelNamespace16functionTemplateIiEERDaRT_ = private unnamed_addr constant [64 x i8] c"auto &ClassInTopLevelNamespace::functionTemplate(T &) [T = int]\00"
14 // CHECK-DAG: @__func__._ZN24ClassInTopLevelNamespace16variadicFunctionEPiz = private unnamed_addr constant [17 x i8] c"variadicFunction\00"
15 // CHECK-DAG: @__PRETTY_FUNCTION__._ZN24ClassInTopLevelNamespace16variadicFunctionEPiz = private unnamed_addr constant [70 x i8] c"decltype(auto) ClassInTopLevelNamespace::variadicFunction(int *, ...)\00"
17 // CHECK-DAG: @__func__._ZN24ClassInTopLevelNamespace25topLevelNamespaceFunctionEv = private unnamed_addr constant [26 x i8] c"topLevelNamespaceFunction\00"
18 // CHECK-DAG: @__PRETTY_FUNCTION__._ZN24ClassInTopLevelNamespace25topLevelNamespaceFunctionEv = private unnamed_addr constant [60 x i8] c"auto *ClassInTopLevelNamespace::topLevelNamespaceFunction()\00"
20 // CHECK-DAG: @__func__.___ZN16ClassBlockConstrD2Ev_block_invoke = private unnamed_addr constant [31 x i8] c"~ClassBlockConstr_block_invoke\00"
21 // CHECK-DAG: @__func__.___ZN16ClassBlockConstrC2Ev_block_invoke = private unnamed_addr constant [30 x i8] c"ClassBlockConstr_block_invoke\00"
23 // CHECK-DAG: private unnamed_addr constant [32 x i8] c"const char *ConstexprPrettyFn()\00"
25 int printf(const char * _Format
, ...);
27 class ClassInTopLevelNamespace
{
29 auto *topLevelNamespaceFunction() {
30 printf("__func__ %s\n", __func__
);
31 printf("__FUNCTION__ %s\n", __FUNCTION__
);
32 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__
);
33 return static_cast<int *>(nullptr);
36 decltype(auto) variadicFunction(int *a
, ...) {
37 printf("__func__ %s\n", __func__
);
38 printf("__FUNCTION__ %s\n", __FUNCTION__
);
39 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__
);
44 auto &functionTemplate(T
&t
) {
45 printf("__func__ %s\n", __func__
);
46 printf("__FUNCTION__ %s\n", __FUNCTION__
);
47 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__
);
55 const auto &classTemplateFunction(T
&t
) {
56 printf("__func__ %s\n", __func__
);
57 printf("__FUNCTION__ %s\n", __FUNCTION__
);
58 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__
);
63 struct ClassBlockConstr
{
66 const char * (^b
)() = ^() {
72 const char * (^b
)() = ^() {
84 FuncTemplate() : Func(__func__
) {}
85 const char *getFunc() const { return Func
; }
88 constexpr const char* ConstexprPrettyFn() {
89 return __PRETTY_FUNCTION__
;
91 const char* ConstexprPrettyVar
= ConstexprPrettyFn();
96 ClassInTopLevelNamespace topLevelNamespace
;
97 ClassBlockConstr classBlockConstr
;
98 topLevelNamespace
.topLevelNamespaceFunction();
99 topLevelNamespace
.variadicFunction(&a
);
100 topLevelNamespace
.functionTemplate(a
);
102 ClassTemplate
<int> t
;
103 t
.classTemplateFunction(a
);
108 FuncTemplate
<int> FTi
;