diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-12-07 18:32:03 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-12-07 18:32:03 +0000 |
commit | 954e0c75c42f321945aff8b9ee96da43cd90c752 (patch) | |
tree | f822bea1b21f8345435265d63e4ff5b6216e0d10 /test/ASTMerge | |
parent | 56ed7927232256516efcf6afb7bd59bad1e7af71 (diff) |
Implement AST import for Objective-C property implementations
(@synthesize and @dynamic).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121159 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ASTMerge')
-rw-r--r-- | test/ASTMerge/Inputs/property1.m | 19 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/property2.m | 20 | ||||
-rw-r--r-- | test/ASTMerge/property.m | 6 |
3 files changed, 44 insertions, 1 deletions
diff --git a/test/ASTMerge/Inputs/property1.m b/test/ASTMerge/Inputs/property1.m index 37887a34f7..22fe0a0222 100644 --- a/test/ASTMerge/Inputs/property1.m +++ b/test/ASTMerge/Inputs/property1.m @@ -10,3 +10,22 @@ @property (readonly) float Prop1; @end +// Properties with implementations +@interface I3 { + int ivar1; + int ivar2; + int ivar3; + int Prop4; +} +@property int Prop1; +@property int Prop2; +@property int Prop3; +@property int Prop4; +@end + +@implementation I3 +@synthesize Prop1 = ivar1; +@synthesize Prop2 = ivar3; +@dynamic Prop3; +@synthesize Prop4; +@end diff --git a/test/ASTMerge/Inputs/property2.m b/test/ASTMerge/Inputs/property2.m index 6039f10ec6..64a03fb04e 100644 --- a/test/ASTMerge/Inputs/property2.m +++ b/test/ASTMerge/Inputs/property2.m @@ -11,3 +11,23 @@ @interface I2 @property (readonly) int Prop1; @end + +// Properties with implementations +@interface I3 { + int ivar1; + int ivar2; + int ivar3; + int Prop4; +} +@property int Prop1; +@property int Prop2; +@property int Prop3; +@property int Prop4; +@end + +@implementation I3 +@synthesize Prop2 = ivar2; +@synthesize Prop1 = ivar1; +@synthesize Prop3 = ivar3; +@synthesize Prop4 = Prop4; +@end diff --git a/test/ASTMerge/property.m b/test/ASTMerge/property.m index 5f7a7308da..a8dd7c420c 100644 --- a/test/ASTMerge/property.m +++ b/test/ASTMerge/property.m @@ -6,4 +6,8 @@ // CHECK: property1.m:10:28: note: declared here with type 'float' // CHECK: property2.m:12:26: error: instance method 'Prop1' has incompatible result types in different translation units ('int' vs. 'float') // CHECK: property1.m:10:28: note: instance method 'Prop1' also declared here -// CHECK: 2 errors generated. +// CHECK: property1.m:28:21: error: property 'Prop2' is synthesized to different ivars in different translation units ('ivar3' vs. 'ivar2') +// CHECK: property2.m:29:21: note: property is synthesized to ivar 'ivar2' here +// CHECK: property1.m:29:10: error: property 'Prop3' is implemented with @dynamic in one translation but @synthesize in another translation unit +// CHECK: property2.m:31:13: note: property 'Prop3' is implemented with @synthesize here +// CHECK: 4 errors generated. |