StmtPrinter: factor out arg printing code to PrintCallArgs
[clang.git] / test / CodeGenObjC / predefined-expr.m
blob43d329e2ab1d3dc6d48e33d51dcf509ae2c2a106
1 // RUN: %clang_cc1 -triple i386-apple-darwin9 %s -emit-llvm -o - | FileCheck %s
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"
14 int printf(const char * _Format, ...);
16 @interface Foo
17 @end
19 @implementation Foo
21 - (void)instanceTest1 {
22   printf("__func__: %s\n", __func__);
23   printf("__FUNCTION__: %s\n", __FUNCTION__);
24   printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__);
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__);
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__);
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;
46 + (void)classTest1 {
47   printf("__func__: %s\n", __func__);
48   printf("__FUNCTION__: %s\n", __FUNCTION__);
49   printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__);
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__);
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__);
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;
71 @end
73 @interface Foo (Category)
74 @end
76 @implementation Foo (Category)
78 - (void)instanceTestWithCategory {
79   printf("__func__: %s\n", __func__);
80   printf("__FUNCTION__: %s\n", __FUNCTION__);
81   printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__);
84 + (void)classTestWithCategory {
85   printf("__func__: %s\n", __func__);
86   printf("__FUNCTION__: %s\n", __FUNCTION__);
87   printf("__PRETTY_FUNCTION__: %s\n\n", __PRETTY_FUNCTION__);
90 @end