]> git.proxmox.com Git - rustc.git/blame - src/llvm/tools/clang/test/CodeGen/predefined-expr.c
Imported Upstream version 0.6
[rustc.git] / src / llvm / tools / clang / test / CodeGen / predefined-expr.c
CommitLineData
223e47cc
LB
1// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
2
3// CHECK: @__func__.plainFunction = private unnamed_addr constant [14 x i8] c"plainFunction\00"
4// CHECK: @__PRETTY_FUNCTION__.plainFunction = private unnamed_addr constant [21 x i8] c"void plainFunction()\00"
5// CHECK: @__func__.externFunction = private unnamed_addr constant [15 x i8] c"externFunction\00"
6// CHECK: @__PRETTY_FUNCTION__.externFunction = private unnamed_addr constant [22 x i8] c"void externFunction()\00"
7// CHECK: @__func__.privateExternFunction = private unnamed_addr constant [22 x i8] c"privateExternFunction\00"
8// CHECK: @__PRETTY_FUNCTION__.privateExternFunction = private unnamed_addr constant [29 x i8] c"void privateExternFunction()\00"
9// CHECK: @__func__.staticFunction = private unnamed_addr constant [15 x i8] c"staticFunction\00"
10// CHECK: @__PRETTY_FUNCTION__.staticFunction = private unnamed_addr constant [22 x i8] c"void staticFunction()\00"
11
12int printf(const char *, ...);
13
14void plainFunction() {
15 printf("__func__ %s\n", __func__);
16 printf("__FUNCTION__ %s\n", __FUNCTION__);
17 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
18}
19
20extern void externFunction() {
21 printf("__func__ %s\n", __func__);
22 printf("__FUNCTION__ %s\n", __FUNCTION__);
23 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
24}
25
26__private_extern__ void privateExternFunction() {
27 printf("__func__ %s\n", __func__);
28 printf("__FUNCTION__ %s\n", __FUNCTION__);
29 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
30}
31
32static void staticFunction() {
33 printf("__func__ %s\n", __func__);
34 printf("__FUNCTION__ %s\n", __FUNCTION__);
35 printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
36}
37
38int main() {
39 plainFunction();
40 externFunction();
41 privateExternFunction();
42 staticFunction();
43
44 return 0;
45}