summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2008-12-09 20:23:04 +0000
committerFariborz Jahanian <fjahanian@apple.com>2008-12-09 20:23:04 +0000
commit3d8552a75d03dd1981939134a17b3918c28dc762 (patch)
treea9cd77fc44db325c0ee435c5dda28bc445ffe7b7 /clang/test/CodeGenObjC
parentc13f26873fbda0ff998d89e564233987b6068b35 (diff)
downloadbcm5719-llvm-3d8552a75d03dd1981939134a17b3918c28dc762.tar.gz
bcm5719-llvm-3d8552a75d03dd1981939134a17b3918c28dc762.zip
Support for implementation of property in the case where
the synthesis is in an implementation of s subclass of a super class where the property has been declared. llvm-svn: 60792
Diffstat (limited to 'clang/test/CodeGenObjC')
-rw-r--r--clang/test/CodeGenObjC/newproperty-nested-synthesis-1.m78
1 files changed, 78 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/newproperty-nested-synthesis-1.m b/clang/test/CodeGenObjC/newproperty-nested-synthesis-1.m
new file mode 100644
index 00000000000..208b162b50f
--- /dev/null
+++ b/clang/test/CodeGenObjC/newproperty-nested-synthesis-1.m
@@ -0,0 +1,78 @@
+// RUN: clang -fnext-runtime --emit-llvm -o %t %s
+
+@interface Object
+- (id) new;
+@end
+
+@interface Tester : Object
+@property char PropertyAtomic_char;
+@property short PropertyAtomic_short;
+@property int PropertyAtomic_int;
+@property long PropertyAtomic_long;
+@property long long PropertyAtomic_longlong;
+@property float PropertyAtomic_float;
+@property double PropertyAtomic_double;
+@property(assign) id PropertyAtomic_id;
+@property(retain) id PropertyAtomicRetained_id;
+@property(copy) id PropertyAtomicRetainedCopied_id;
+@property(retain) id PropertyAtomicRetainedGCOnly_id;
+@property(copy) id PropertyAtomicRetainedCopiedGCOnly_id;
+@end
+
+@implementation Tester
+@dynamic PropertyAtomic_char;
+@dynamic PropertyAtomic_short;
+@dynamic PropertyAtomic_int;
+@dynamic PropertyAtomic_long;
+@dynamic PropertyAtomic_longlong;
+@dynamic PropertyAtomic_float;
+@dynamic PropertyAtomic_double;
+@dynamic PropertyAtomic_id;
+@dynamic PropertyAtomicRetained_id;
+@dynamic PropertyAtomicRetainedCopied_id;
+@dynamic PropertyAtomicRetainedGCOnly_id;
+@dynamic PropertyAtomicRetainedCopiedGCOnly_id;
+@end
+
+@interface SubClass : Tester
+{
+ char PropertyAtomic_char;
+ short PropertyAtomic_short;
+ int PropertyAtomic_int;
+ long PropertyAtomic_long;
+ long long PropertyAtomic_longlong;
+ float PropertyAtomic_float;
+ double PropertyAtomic_double;
+ id PropertyAtomic_id;
+ id PropertyAtomicRetained_id;
+ id PropertyAtomicRetainedCopied_id;
+ id PropertyAtomicRetainedGCOnly_id;
+ id PropertyAtomicRetainedCopiedGCOnly_id;
+}
+@end
+
+@implementation SubClass
+@synthesize PropertyAtomic_char;
+@synthesize PropertyAtomic_short;
+@synthesize PropertyAtomic_int;
+@synthesize PropertyAtomic_long;
+@synthesize PropertyAtomic_longlong;
+@synthesize PropertyAtomic_float;
+@synthesize PropertyAtomic_double;
+@synthesize PropertyAtomic_id;
+@synthesize PropertyAtomicRetained_id;
+@synthesize PropertyAtomicRetainedCopied_id;
+@synthesize PropertyAtomicRetainedGCOnly_id;
+@synthesize PropertyAtomicRetainedCopiedGCOnly_id;
+@end
+
+int main()
+{
+ SubClass *f = [SubClass new];
+ f.PropertyAtomic_int = 1;
+
+ f.PropertyAtomic_int += 3;
+
+ f.PropertyAtomic_int -= 4;
+ return f.PropertyAtomic_int;
+}
OpenPOWER on IntegriCloud