diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2008-11-26 20:01:34 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2008-11-26 20:01:34 +0000 |
| commit | f8ef9f3dc9e8ceadd3772052624a455bbbfb0ffb (patch) | |
| tree | f69c3e204f3a473e2ae4bd47a23103df2819a44c /clang/test/CodeGenObjC | |
| parent | 6e41adddabbd28bb6d0f7baeef1eade960237b9f (diff) | |
| download | bcm5719-llvm-f8ef9f3dc9e8ceadd3772052624a455bbbfb0ffb.tar.gz bcm5719-llvm-f8ef9f3dc9e8ceadd3772052624a455bbbfb0ffb.zip | |
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.
llvm-svn: 60114
Diffstat (limited to 'clang/test/CodeGenObjC')
| -rw-r--r-- | clang/test/CodeGenObjC/continuation-class.m | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/continuation-class.m b/clang/test/CodeGenObjC/continuation-class.m new file mode 100644 index 00000000000..9ac51c70bf0 --- /dev/null +++ b/clang/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; +} + |

