summaryrefslogtreecommitdiffstats
path: root/clang/test/ASTMerge
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-02-17 18:02:10 +0000
committerDouglas Gregor <dgregor@apple.com>2010-02-17 18:02:10 +0000
commita11c45866eba33eda0f4c74c952273b24f23d270 (patch)
treef0338358169ff82a4f291360da7c7b0767770c18 /clang/test/ASTMerge
parent231461f88f9fa2b3b1f1b5136d9810d16bffcbac (diff)
downloadbcm5719-llvm-a11c45866eba33eda0f4c74c952273b24f23d270.tar.gz
bcm5719-llvm-a11c45866eba33eda0f4c74c952273b24f23d270.zip
Implement AST merging for Objective-C properties.
llvm-svn: 96483
Diffstat (limited to 'clang/test/ASTMerge')
-rw-r--r--clang/test/ASTMerge/Inputs/property1.m12
-rw-r--r--clang/test/ASTMerge/Inputs/property2.m13
-rw-r--r--clang/test/ASTMerge/property.m9
3 files changed, 34 insertions, 0 deletions
diff --git a/clang/test/ASTMerge/Inputs/property1.m b/clang/test/ASTMerge/Inputs/property1.m
new file mode 100644
index 00000000000..37887a34f76
--- /dev/null
+++ b/clang/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/clang/test/ASTMerge/Inputs/property2.m b/clang/test/ASTMerge/Inputs/property2.m
new file mode 100644
index 00000000000..6039f10ec6e
--- /dev/null
+++ b/clang/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/clang/test/ASTMerge/property.m b/clang/test/ASTMerge/property.m
new file mode 100644
index 00000000000..0fd7e4872d7
--- /dev/null
+++ b/clang/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.
OpenPOWER on IntegriCloud