diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-02-17 18:02:10 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-02-17 18:02:10 +0000 |
commit | e3261624c1870e52d7efc2ac83e647713361ac6c (patch) | |
tree | 7865bd5537d87a0b8f7fdd405a7455ecdbf6baf7 /test/ASTMerge | |
parent | d5c7ccab042670ce43790106dfa19efe64cc30be (diff) |
Implement AST merging for Objective-C properties.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96483 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ASTMerge')
-rw-r--r-- | test/ASTMerge/Inputs/property1.m | 12 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/property2.m | 13 | ||||
-rw-r--r-- | test/ASTMerge/property.m | 9 |
3 files changed, 34 insertions, 0 deletions
diff --git a/test/ASTMerge/Inputs/property1.m b/test/ASTMerge/Inputs/property1.m new file mode 100644 index 0000000000..37887a34f7 --- /dev/null +++ b/test/ASTMerge/Inputs/property1.m @@ -0,0 +1,12 @@ +// Matching properties +@interface I1 { +} +- (int)getProp2; +- (void)setProp2:(int)value; +@end + +// Mismatched property +@interface I2 +@property (readonly) float Prop1; +@end + diff --git a/test/ASTMerge/Inputs/property2.m b/test/ASTMerge/Inputs/property2.m new file mode 100644 index 0000000000..6039f10ec6 --- /dev/null +++ b/test/ASTMerge/Inputs/property2.m @@ -0,0 +1,13 @@ +// Matching properties +@interface I1 { +} +- (int)getProp2; +- (void)setProp2:(int)value; +@property (readonly) int Prop1; +@property (getter = getProp2, setter = setProp2:) int Prop2; +@end + +// Mismatched property +@interface I2 +@property (readonly) int Prop1; +@end diff --git a/test/ASTMerge/property.m b/test/ASTMerge/property.m new file mode 100644 index 0000000000..0fd7e4872d --- /dev/null +++ b/test/ASTMerge/property.m @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/property1.m +// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/property2.m +// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s + +// CHECK: property2.m:12:26: error: property 'Prop1' declared with incompatible types in different translation units ('int' vs. 'float') +// 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: 4 diagnostics generated. |