diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2015-12-03 17:44:51 +0000 |
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2015-12-03 17:44:51 +0000 |
| commit | 08c9333df2916dff643e7c5d6174867f199af0cb (patch) | |
| tree | 4da76242d850440f6829b3ead6c11014d71908a0 /clang/test/CodeGenObjC | |
| parent | 0d4505c0677796aba5a54069154c8ae491786c0f (diff) | |
| download | bcm5719-llvm-08c9333df2916dff643e7c5d6174867f199af0cb.tar.gz bcm5719-llvm-08c9333df2916dff643e7c5d6174867f199af0cb.zip | |
Fix Objective-C metadata for properties from class extensions after r251874
After, properties from class extensions no longer show up in
ObjCInterfaceDecl::properties(). Make ObjCCommonMac::EmitPropertyList()
explicitly look for properties in class extensions before looking at
direct properties.
Also add a test that passes both with clang before r251874 and after this
patch (but fails with r251874 and without this patch).
llvm-svn: 254622
Diffstat (limited to 'clang/test/CodeGenObjC')
| -rw-r--r-- | clang/test/CodeGenObjC/property-list-in-extension.m | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/property-list-in-extension.m b/clang/test/CodeGenObjC/property-list-in-extension.m new file mode 100644 index 00000000000..18174fe6bab --- /dev/null +++ b/clang/test/CodeGenObjC/property-list-in-extension.m @@ -0,0 +1,39 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s + +// Checks metadata for properties in a few cases. + + +// Property from a class extension: +@interface Foo +@end + +@interface Foo() +@property int myprop; +@end + +@implementation Foo +@synthesize myprop = _myprop; +@end +// Metadata for _myprop should be present, and PROP_LIST for Foo should have +// only one entry. +// CHECK: = private global [12 x i8] c"Ti,V_myprop\00", +// CHECK: @"\01l_OBJC_$_PROP_LIST_Foo" = private global { i32, i32, [1 x %struct._prop_t] } + +// Readonly property in interface made readwrite in a category: +@interface FooRO +@property (readonly) int evolvingprop; +@end + +@interface FooRO () +@property int evolvingprop; +@end + +@implementation FooRO +@synthesize evolvingprop = _evolvingprop; +@end +// Metadata for _evolvingprop should be present, and PROP_LIST for FooRO should +// still have only one entry, and the one entry should point to the version of +// the property with a getter and setter. +// CHECK: [[getter:@OBJC_PROP_NAME_ATTR[^ ]+]] = private global [13 x i8] c"evolvingprop\00" +// CHECK: [[setter:@OBJC_PROP_NAME_ATTR[^ ]+]] = private global [18 x i8] c"Ti,V_evolvingprop\00", +// CHECK: @"\01l_OBJC_$_PROP_LIST_FooRO" = private global { i32, i32, [1 x %struct._prop_t] }{{.*}}[[getter]]{{.*}}[[setter]] |

