1 // RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
2 // RUN: %clang_cc1 -fms-extensions %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
3 
4 // CHECK: @__func__.plainFunction = private unnamed_addr constant [14 x i8] c"plainFunction\00"
5 // CHECK: @__PRETTY_FUNCTION__.plainFunction = private unnamed_addr constant [21 x i8] c"void plainFunction()\00"
6 // CHECK: @__func__.externFunction = private unnamed_addr constant [15 x i8] c"externFunction\00"
7 // CHECK: @__PRETTY_FUNCTION__.externFunction = private unnamed_addr constant [22 x i8] c"void externFunction()\00"
8 // CHECK: @__func__.privateExternFunction = private unnamed_addr constant [22 x i8] c"privateExternFunction\00"
9 // CHECK: @__PRETTY_FUNCTION__.privateExternFunction = private unnamed_addr constant [29 x i8] c"void privateExternFunction()\00"
10 // CHECK: @__func__.__captured_stmt = private unnamed_addr constant [25 x i8] c"functionWithCapturedStmt\00"
11 // CHECK: @__PRETTY_FUNCTION__.__captured_stmt = private unnamed_addr constant [32 x i8] c"void functionWithCapturedStmt()\00"
12 // CHECK: @__func__.staticFunction = private unnamed_addr constant [15 x i8] c"staticFunction\00"
13 // CHECK: @__PRETTY_FUNCTION__.staticFunction = private unnamed_addr constant [22 x i8] c"void staticFunction()\00"
14 
15 int printf(const char *, ...);
16 
plainFunction()17 void plainFunction() {
18   printf("__func__ %s\n", __func__);
19   printf("__FUNCTION__ %s\n", __FUNCTION__);
20   printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
21 }
22 
externFunction()23 extern void externFunction() {
24   printf("__func__ %s\n", __func__);
25   printf("__FUNCTION__ %s\n", __FUNCTION__);
26   printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
27 }
28 
privateExternFunction()29 __private_extern__ void privateExternFunction() {
30   printf("__func__ %s\n", __func__);
31   printf("__FUNCTION__ %s\n", __FUNCTION__);
32   printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
33 }
34 
functionWithCapturedStmt()35 void functionWithCapturedStmt() {
36   #pragma clang __debug captured
37   {
38     printf("__func__ %s\n", __func__);
39     printf("__FUNCTION__ %s\n", __FUNCTION__);
40     printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
41   }
42 }
43 
staticFunction()44 static void staticFunction() {
45   printf("__func__ %s\n", __func__);
46   printf("__FUNCTION__ %s\n", __FUNCTION__);
47   printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
48 }
49 
main()50 int main() {
51   plainFunction();
52   externFunction();
53   privateExternFunction();
54   functionWithCapturedStmt();
55   staticFunction();
56 
57   return 0;
58 }
59