llvm-project
90 строк · 3.2 Кб
1// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 %s -emit-llvm -o - | FileCheck %s
2
3// CHECK: @"__func__.-[Foo instanceTest1]" = private unnamed_addr constant [21 x i8] c"-[Foo instanceTest1]\00"
4// CHECK: @"__func__.-[Foo instanceTest2:]" = private unnamed_addr constant [22 x i8] c"-[Foo instanceTest2:]\00"
5// CHECK: @"__func__.-[Foo instanceTest3:withB:]" = private unnamed_addr constant [28 x i8] c"-[Foo instanceTest3:withB:]\00"
6// CHECK: @"__func__.-[Foo instanceTest4]" = private unnamed_addr constant [21 x i8] c"-[Foo instanceTest4]\00"
7// CHECK: @"__func__.+[Foo classTest1]" = private unnamed_addr constant [18 x i8] c"+[Foo classTest1]\00"
8// CHECK: @"__func__.+[Foo classTest2:]" = private unnamed_addr constant [19 x i8] c"+[Foo classTest2:]\00"
9// CHECK: @"__func__.+[Foo classTest3:withB:]" = private unnamed_addr constant [25 x i8] c"+[Foo classTest3:withB:]\00"
10// CHECK: @"__func__.+[Foo classTest4]" = private unnamed_addr constant [18 x i8] c"+[Foo classTest4]\00"
11// CHECK: @"__func__.-[Foo(Category) instanceTestWithCategory]" = private unnamed_addr constant [42 x i8] c"-[Foo(Category) instanceTestWithCategory]\00"
12// CHECK: @"__func__.+[Foo(Category) classTestWithCategory]" = private unnamed_addr constant [39 x i8] c"+[Foo(Category) classTestWithCategory]\00"
13
14int printf(const char * _Format, ...);
15
16@interface Foo
17@end
18
19@implementation Foo
20
21- (void)instanceTest1 {
22printf("__func__: %s\n", __func__);
23printf("__FUNCTION__: %s\n", __FUNCTION__);
24printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__);
25}
26
27- (void)instanceTest2:(int)i {
28printf("__func__: %s\n", __func__);
29printf("__FUNCTION__: %s\n", __FUNCTION__);
30printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__);
31}
32
33- (void)instanceTest3:(int)a withB:(double)b {
34printf("__func__: %s\n", __func__);
35printf("__FUNCTION__: %s\n", __FUNCTION__);
36printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__);
37}
38
39- (int)instanceTest4 {
40printf("__func__: %s\n", __func__);
41printf("__FUNCTION__: %s\n", __FUNCTION__);
42printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__);
43return 0;
44}
45
46+ (void)classTest1 {
47printf("__func__: %s\n", __func__);
48printf("__FUNCTION__: %s\n", __FUNCTION__);
49printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__);
50}
51
52+ (void)classTest2:(int)i {
53printf("__func__: %s\n", __func__);
54printf("__FUNCTION__: %s\n", __FUNCTION__);
55printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__);
56}
57
58+ (void)classTest3:(int)a withB:(double)b {
59printf("__func__: %s\n", __func__);
60printf("__FUNCTION__: %s\n", __FUNCTION__);
61printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__);
62}
63
64+ (int)classTest4 {
65printf("__func__: %s\n", __func__);
66printf("__FUNCTION__: %s\n", __FUNCTION__);
67printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__);
68return 0;
69}
70
71@end
72
73@interface Foo (Category)
74@end
75
76@implementation Foo (Category)
77
78- (void)instanceTestWithCategory {
79printf("__func__: %s\n", __func__);
80printf("__FUNCTION__: %s\n", __FUNCTION__);
81printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__);
82}
83
84+ (void)classTestWithCategory {
85printf("__func__: %s\n", __func__);
86printf("__FUNCTION__: %s\n", __FUNCTION__);
87printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__);
88}
89
90@end
91