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