1*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -g -o - | FileCheck %s 2f4a2713aSLionel Sambuc 3f4a2713aSLionel Sambucclass S { 4f4a2713aSLionel Sambucpublic: 5f4a2713aSLionel Sambuc S& operator = (const S&); 6f4a2713aSLionel Sambuc S (const S&); 7f4a2713aSLionel Sambuc S (); 8f4a2713aSLionel Sambuc}; 9f4a2713aSLionel Sambuc 10f4a2713aSLionel Sambucstruct CGRect { 11f4a2713aSLionel Sambuc CGRect & operator = (const CGRect &); 12f4a2713aSLionel Sambuc}; 13f4a2713aSLionel Sambuc 14f4a2713aSLionel Sambuc@interface I { 15f4a2713aSLionel Sambuc S position; 16f4a2713aSLionel Sambuc CGRect bounds; 17f4a2713aSLionel Sambuc} 18f4a2713aSLionel Sambuc 19f4a2713aSLionel Sambuc@property(assign, nonatomic) S position; 20f4a2713aSLionel Sambuc@property CGRect bounds; 21f4a2713aSLionel Sambuc@property CGRect frame; 22f4a2713aSLionel Sambuc- (void)setFrame:(CGRect)frameRect; 23f4a2713aSLionel Sambuc- (CGRect)frame; 24f4a2713aSLionel Sambuc- (void) initWithOwner; 25f4a2713aSLionel Sambuc- (CGRect)extent; 26f4a2713aSLionel Sambuc- (void)dealloc; 27f4a2713aSLionel Sambuc@end 28f4a2713aSLionel Sambuc 29f4a2713aSLionel Sambuc@implementation I 30f4a2713aSLionel Sambuc@synthesize position; 31f4a2713aSLionel Sambuc@synthesize bounds; 32f4a2713aSLionel Sambuc@synthesize frame; 33f4a2713aSLionel Sambuc 34f4a2713aSLionel Sambuc// CHECK: define internal void @"\01-[I setPosition:]" 35*0a6a1f1dSLionel Sambuc// CHECK: call dereferenceable({{[0-9]+}}) %class.S* @_ZN1SaSERKS_ 36f4a2713aSLionel Sambuc// CHECK-NEXT: ret void 37f4a2713aSLionel Sambuc 38*0a6a1f1dSLionel Sambuc// Don't attach debug locations to the prologue instructions. These were 39*0a6a1f1dSLionel Sambuc// leaking over from the previous function emission by accident. 40*0a6a1f1dSLionel Sambuc// CHECK: define internal void @"\01-[I setBounds:]" 41*0a6a1f1dSLionel Sambuc// CHECK-NOT: !dbg 42*0a6a1f1dSLionel Sambuc// CHECK: call void @llvm.dbg.declare 43f4a2713aSLionel Sambuc- (void)setFrame:(CGRect)frameRect {} 44f4a2713aSLionel Sambuc- (CGRect)frame {return bounds;} 45f4a2713aSLionel Sambuc 46f4a2713aSLionel Sambuc- (void)initWithOwner { 47f4a2713aSLionel Sambuc I* _labelLayer; 48f4a2713aSLionel Sambuc CGRect labelLayerFrame = self.bounds; 49f4a2713aSLionel Sambuc labelLayerFrame = self.bounds; 50f4a2713aSLionel Sambuc _labelLayer.frame = labelLayerFrame; 51f4a2713aSLionel Sambuc} 52f4a2713aSLionel Sambuc 53f4a2713aSLionel Sambuc// rdar://8366604 54f4a2713aSLionel Sambuc- (void)dealloc 55f4a2713aSLionel Sambuc { 56f4a2713aSLionel Sambuc CGRect cgrect = self.extent; 57f4a2713aSLionel Sambuc } 58f4a2713aSLionel Sambuc- (struct CGRect)extent {return bounds;} 59f4a2713aSLionel Sambuc 60f4a2713aSLionel Sambuc@end 61f4a2713aSLionel Sambuc 62f4a2713aSLionel Sambuc// CHECK-LABEL: define i32 @main 63*0a6a1f1dSLionel Sambuc// CHECK: call void @_ZN1SC1ERKS_(%class.S* [[AGGTMP:%[a-zA-Z0-9\.]+]], %class.S* dereferenceable({{[0-9]+}}) {{%[a-zA-Z0-9\.]+}}) 64f4a2713aSLionel Sambuc// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %class.S*)*)(i8* {{%[a-zA-Z0-9\.]+}}, i8* {{%[a-zA-Z0-9\.]+}}, %class.S* [[AGGTMP]]) 65f4a2713aSLionel Sambuc// CHECK-NEXT: ret i32 0 66f4a2713aSLionel Sambucint main() { 67f4a2713aSLionel Sambuc I *i; 68f4a2713aSLionel Sambuc S s1; 69f4a2713aSLionel Sambuc i.position = s1; 70f4a2713aSLionel Sambuc return 0; 71f4a2713aSLionel Sambuc} 72f4a2713aSLionel Sambuc 73f4a2713aSLionel Sambuc// rdar://8379892 74f4a2713aSLionel Sambuc// CHECK-LABEL: define void @_Z1fP1A 75f4a2713aSLionel Sambuc// CHECK: call void @_ZN1XC1Ev(%struct.X* [[LVTEMP:%[a-zA-Z0-9\.]+]]) 76*0a6a1f1dSLionel Sambuc// CHECK: call void @_ZN1XC1ERKS_(%struct.X* [[AGGTMP:%[a-zA-Z0-9\.]+]], %struct.X* dereferenceable({{[0-9]+}}) [[LVTEMP]]) 77f4a2713aSLionel Sambuc// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %struct.X*)*)({{.*}} %struct.X* [[AGGTMP]]) 78f4a2713aSLionel Sambucstruct X { 79f4a2713aSLionel Sambuc X(); 80f4a2713aSLionel Sambuc X(const X&); 81f4a2713aSLionel Sambuc ~X(); 82f4a2713aSLionel Sambuc}; 83f4a2713aSLionel Sambuc 84f4a2713aSLionel Sambuc@interface A { 85f4a2713aSLionel Sambuc X xval; 86f4a2713aSLionel Sambuc} 87f4a2713aSLionel Sambuc- (X)x; 88f4a2713aSLionel Sambuc- (void)setX:(X)x; 89f4a2713aSLionel Sambuc@end 90f4a2713aSLionel Sambuc 91f4a2713aSLionel Sambucvoid f(A* a) { 92f4a2713aSLionel Sambuc a.x = X(); 93f4a2713aSLionel Sambuc} 94