diff options
author | Zancanaro; Carlo <czan8762@plang3.cs.usyd.edu.au> | 2012-09-24 09:58:17 +1000 |
---|---|---|
committer | Zancanaro; Carlo <czan8762@plang3.cs.usyd.edu.au> | 2012-09-24 09:58:17 +1000 |
commit | 222e2a7620e6520ffaf4fc4e69d79c18da31542e (patch) | |
tree | 7bfbc05bfa3b41c8f9d2e56d53a0bc3e310df239 /clang/test/CodeGenObjCXX/property-objects.mm | |
parent | 3d206f03985b50beacae843d880bccdc91a9f424 (diff) |
Add the clang library to the repo (with some of my changes, too).
Diffstat (limited to 'clang/test/CodeGenObjCXX/property-objects.mm')
-rw-r--r-- | clang/test/CodeGenObjCXX/property-objects.mm | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjCXX/property-objects.mm b/clang/test/CodeGenObjCXX/property-objects.mm new file mode 100644 index 0000000..6dfcc27 --- /dev/null +++ b/clang/test/CodeGenObjCXX/property-objects.mm @@ -0,0 +1,78 @@ +// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s +// CHECK-NOT: callq _objc_msgSend_stret +// CHECK: call void @_ZN1SC1ERKS_ +// CHECK: call %class.S* @_ZN1SaSERKS_ +// CHECK: call %struct.CGRect* @_ZN6CGRectaSERKS_ + +class S { +public: + S& operator = (const S&); + S (const S&); + S (); +}; + +struct CGRect { + CGRect & operator = (const CGRect &); +}; + +@interface I { + S position; + CGRect bounds; +} +@property(assign, nonatomic) S position; +@property CGRect bounds; +@property CGRect frame; +- (void)setFrame:(CGRect)frameRect; +- (CGRect)frame; +- (void) initWithOwner; +- (struct CGRect)extent; +- (void)dealloc; +@end + +@implementation I +@synthesize position; +@synthesize bounds; +@synthesize frame; +- (void)setFrame:(CGRect)frameRect {} +- (CGRect)frame {return bounds;} + +- (void)initWithOwner { + I* _labelLayer; + CGRect labelLayerFrame = self.bounds; + labelLayerFrame = self.bounds; + _labelLayer.frame = labelLayerFrame; +} +// rdar://8366604 +- (void)dealloc + { + CGRect cgrect = self.extent; + } +- (struct CGRect)extent {return bounds;} +@end + +int main() { + I *i; + S s1; + i.position = s1; + return 0; +} + +// rdar://8379892 +// CHECK: define void @_Z1fP1A +// CHECK: @objc_msgSend to void +struct X { + X(); + X(const X&); + ~X(); +}; + +@interface A { + X xval; +} +- (X)x; +- (void)setX:(X)x; +@end + +void f(A* a) { + a.x = X(); +} |