1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s
2 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-NF
4 // Most of this test is apparently just verifying that we don't crash.
6 int printf(const char *, ...);
19 +(void) printThisInt: (int) arg0 andThatFloat: (float) arg1 andADouble: (double) arg2 andAPoint: (MyPoint) arg3;
20 +(float) returnAFloat;
21 +(double) returnADouble;
22 +(MyPoint) returnAPoint;
23 +(void) printThisSize: (MySize) arg0;
24 +(MySize) returnASize;
26 -(void) printThisInt: (int) arg0 andThatFloat: (float) arg1 andADouble: (double) arg2 andAPoint: (MyPoint) arg3;
27 -(float) returnAFloat;
28 -(double) returnADouble;
29 -(MyPoint) returnAPoint;
30 -(void) printThisSize: (MySize) arg0;
31 -(MySize) returnASize;
37 +(void) printThisInt: (int) arg0 andThatFloat: (float) arg1 andADouble: (double) arg2 andAPoint: (MyPoint) arg3 {
38 printf("(CLASS) theInt: %d, theFloat: %f, theDouble: %f, thePoint: { %d, %d }\n",
39 arg0, arg1, arg2, arg3.x, arg3.y);
41 +(float) returnAFloat {
44 +(double) returnADouble {
47 +(MyPoint) returnAPoint {
48 MyPoint x = { 35, 45 };
51 +(void) printThisSize: (MySize) arg0 {
52 printf("(CLASS) theSize: { %f, %f }\n",
53 arg0.width, arg0.height);
55 +(MySize) returnASize {
56 MySize x = { 32, 44 };
60 -(void) printThisInt: (int) arg0 andThatFloat: (float) arg1 andADouble: (double) arg2 andAPoint: (MyPoint) arg3 {
61 printf("theInt: %d, theFloat: %f, theDouble: %f, thePoint: { %d, %d }\n",
62 arg0, arg1, arg2, arg3.x, arg3.y);
64 -(float) returnAFloat {
67 -(double) returnADouble {
70 -(MyPoint) returnAPoint {
71 MyPoint x = { 30, 40 };
74 -(void) printThisSize: (MySize) arg0 {
75 printf("theSize: { %f, %f }\n",
76 arg0.width, arg0.height);
78 -(MySize) returnASize {
79 MySize x = { 22, 34 };
85 +(void) printThisInt: (int) arg0 andThatFloat: (float) arg1 andADouble: (double) arg2 andAPoint: (MyPoint) arg3 {
88 [ super printThisInt: arg0*2 andThatFloat: arg1*2 andADouble: arg2*2 andAPoint: arg3 ];
90 +(void) printThisSize: (MySize) arg0 {
93 [ super printThisSize: arg0 ];
95 +(float) returnAFloat {
96 return [ super returnAFloat ]*2;
98 +(double) returnADouble {
99 return [ super returnADouble ]*2;
101 +(MyPoint) returnAPoint {
102 MyPoint x = [ super returnAPoint ];
107 +(MySize) returnASize {
108 MySize x = [ super returnASize ];
114 -(void) printThisInt: (int) arg0 andThatFloat: (float) arg1 andADouble: (double) arg2 andAPoint: (MyPoint) arg3 {
117 [ super printThisInt: arg0*2 andThatFloat: arg1*2 andADouble: arg2*2 andAPoint: arg3 ];
119 -(void) printThisSize: (MySize) arg0 {
122 [ super printThisSize: arg0 ];
124 -(float) returnAFloat {
125 return [ super returnAFloat ]*2;
127 -(double) returnADouble {
128 return [ super returnADouble ]*2;
130 -(MyPoint) returnAPoint {
131 MyPoint x = [ super returnAPoint ];
136 -(MySize) returnASize {
137 MySize x = [ super returnASize ];
142 -(const float) returnAConstFloat {
147 // CHECK: define{{.*}} void @test0(ptr
148 // CHECK-NF: define{{.*}} void @test0(ptr
150 // CHECK: [[X:%.*]] = alloca ptr
151 // CHECK-NEXT: [[POINT:%.*]] = alloca [[POINT_T:%.*]],
152 // CHECK: [[T0:%.*]] = load ptr, ptr [[X]]
153 // CHECK: icmp eq ptr [[T0]], null
155 // CHECK: call {{.*}} @objc_msgSend_stret
156 // CHECK-NEXT: br label
157 // CHECK: call void @llvm.memset.p0.i64(ptr align 4 [[POINT]], i8 0, i64 48, i1 false)
158 // CHECK-NEXT: br label
160 // CHECK-NF: [[X:%.*]] = alloca ptr
161 // CHECK-NF-NEXT: [[POINT:%.*]] = alloca [[POINT_T:%.*]],
162 // CHECK-NF: [[T0:%.*]] = load ptr, ptr [[X]]
163 // CHECK-NF: icmp eq ptr [[T0]], null
164 // CHECK-NF-NEXT: br i1
165 // CHECK-NF: call {{.*}} @objc_msgSend_stret
166 // CHECK-NF-NEXT: br label
167 // CHECK-NF: call void @llvm.memset.p0.i64(ptr align 4 [[POINT]], i8 0, i64 48, i1 false)
168 // CHECK-NF-NEXT: br label
169 MyPoint point = [x returnAPoint];