summaryrefslogtreecommitdiff
path: root/test/CodeGenObjC/continuation-class.m
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2008-11-26 20:01:34 +0000
committerFariborz Jahanian <fjahanian@apple.com>2008-11-26 20:01:34 +0000
commit8cf0bb3c2a798ce3acacaac2d3178648cd4c65c6 (patch)
tree26cd1dc065d40d95f9e35116fde0872fe9db30f6 /test/CodeGenObjC/continuation-class.m
parent4d6e8dd587f6ae0080b0d3acc9ac6a6a02b1ac3b (diff)
downloadclang-8cf0bb3c2a798ce3acacaac2d3178648cd4c65c6.tar.gz
Set default property attributes on each property.
Implemented anonymous category (also know as continuation class) used to override main class's property attribute. This is work in propgress. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60114 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenObjC/continuation-class.m')
-rw-r--r--test/CodeGenObjC/continuation-class.m35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/CodeGenObjC/continuation-class.m b/test/CodeGenObjC/continuation-class.m
new file mode 100644
index 0000000000..9ac51c70bf
--- /dev/null
+++ b/test/CodeGenObjC/continuation-class.m
@@ -0,0 +1,35 @@
+// RUN: clang -fnext-runtime --emit-llvm -o %t %s
+
+@interface Object
+- (id)new;
+@end
+
+@interface ReadOnly : Object
+{
+ int _object;
+ int _Anotherobject;
+}
+@property(readonly) int object;
+@property(readonly) int Anotherobject;
+@end
+
+@interface ReadOnly ()
+@property(readwrite) int object;
+@property(readwrite, setter = myAnotherobjectSetter:) int Anotherobject;
+@end
+
+@implementation ReadOnly
+@synthesize object = _object;
+@synthesize Anotherobject = _Anotherobject;
+- (void) myAnotherobjectSetter : (int)val {
+ _Anotherobject = val;
+}
+@end
+
+int main(int argc, char **argv) {
+ ReadOnly *test = [ReadOnly new];
+ test.object = 12345;
+ test.Anotherobject = 200;
+ return test.object - 12345 + test.Anotherobject - 200;
+}
+