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 14 int printf(const char * _Format, ...); 15 16 @interface Foo 17 @end 18 19 @implementation Foo 20 21 - (void)instanceTest1 { 22 printf("__func__: %s\n", __func__); 23 printf("__FUNCTION__: %s\n", __FUNCTION__); 24 printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__); 25 } 26 27 - (void)instanceTest2:(int)i { 28 printf("__func__: %s\n", __func__); 29 printf("__FUNCTION__: %s\n", __FUNCTION__); 30 printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__); 31 } 32 33 - (void)instanceTest3:(int)a withB:(double)b { 34 printf("__func__: %s\n", __func__); 35 printf("__FUNCTION__: %s\n", __FUNCTION__); 36 printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__); 37 } 38 39 - (int)instanceTest4 { 40 printf("__func__: %s\n", __func__); 41 printf("__FUNCTION__: %s\n", __FUNCTION__); 42 printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__); 43 return 0; 44 } 45 46 + (void)classTest1 { 47 printf("__func__: %s\n", __func__); 48 printf("__FUNCTION__: %s\n", __FUNCTION__); 49 printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__); 50 } 51 52 + (void)classTest2:(int)i { 53 printf("__func__: %s\n", __func__); 54 printf("__FUNCTION__: %s\n", __FUNCTION__); 55 printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__); 56 } 57 58 + (void)classTest3:(int)a withB:(double)b { 59 printf("__func__: %s\n", __func__); 60 printf("__FUNCTION__: %s\n", __FUNCTION__); 61 printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__); 62 } 63 64 + (int)classTest4 { 65 printf("__func__: %s\n", __func__); 66 printf("__FUNCTION__: %s\n", __FUNCTION__); 67 printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__); 68 return 0; 69 } 70 71 @end 72 73 @interface Foo (Category) 74 @end 75 76 @implementation Foo (Category) 77 78 - (void)instanceTestWithCategory { 79 printf("__func__: %s\n", __func__); 80 printf("__FUNCTION__: %s\n", __FUNCTION__); 81 printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__); 82 } 83 84 + (void)classTestWithCategory { 85 printf("__func__: %s\n", __func__); 86 printf("__FUNCTION__: %s\n", __FUNCTION__); 87 printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__); 88 } 89 90 @end 91