Author: fjahanian
Date: Fri Jul 16 20:16:59 2010
New Revision: 108600

URL: http://llvm.org/viewvc/llvm-project?rev=108600&view=rev
Log:
Another test case for on demand synthesis of ivars.


Added:
    cfe/trunk/test/SemaObjC/default-synthesize-1.m

Added: cfe/trunk/test/SemaObjC/default-synthesize-1.m
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/default-synthesize-1.m?rev=108600&view=auto
==============================================================================
--- cfe/trunk/test/SemaObjC/default-synthesize-1.m (added)
+++ cfe/trunk/test/SemaObjC/default-synthesize-1.m Fri Jul 16 20:16:59 2010
@@ -0,0 +1,88 @@
+// RUN: %clang_cc1 -fsyntax-only -fobjc-nonfragile-abi2 -verify %s
+
+...@interface NSObject 
+- (void) release;
+- (id) retain;
+...@end
+...@class NSString;
+
+...@interface SynthItAll : NSObject
+...@property int howMany;
+...@property (retain) NSString* what;
+...@end
+
+...@implementation SynthItAll
+//@synthesize howMany, what;
+...@end
+
+
+...@interface SynthSetter : NSObject
+...@property (nonatomic) int howMany;  // REM: nonatomic to avoid warnings 
about only implementing one of the pair
+...@property (nonatomic, retain) NSString* what;
+...@end
+
+...@implementation SynthSetter
+//@synthesize howMany, what;
+
+- (int) howMany {
+    return howMany;
+}
+// - (void) setHowMany: (int) value
+
+- (NSString*) what {
+    return what;
+}
+// - (void) setWhat: (NSString*) value    
+...@end
+
+
+...@interface SynthGetter : NSObject
+...@property (nonatomic) int howMany;  // REM: nonatomic to avoid warnings 
about only implementing one of the pair
+...@property (nonatomic, retain) NSString* what;
+...@end
+
+...@implementation SynthGetter
+//@synthesize howMany, what;
+
+// - (int) howMany
+- (void) setHowMany: (int) value {
+    howMany = value;
+}
+
+// - (NSString*) what
+- (void) setWhat: (NSString*) value {
+    if (what != value) {
+        [what release];
+        what = [value retain];
+    }
+}
+...@end
+
+
+...@interface SynthNone : NSObject
+...@property int howMany;
+...@property (retain) NSString* what;
+...@end
+
+...@implementation SynthNone
+//@synthesize howMany, what;  // REM: Redundant anyway
+
+- (int) howMany {
+    return howMany;
+}
+- (void) setHowMany: (int) value {
+    howMany = value;
+}
+
+- (NSString*) what {
+    return what;
+}
+- (void) setWhat: (NSString*) value {
+    if (what != value) {
+        [what release];
+        what = [value retain];
+    }
+}
+...@end
+
+


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to