diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/ASTMerge/Inputs/interface1.m | 24 | ||||
-rw-r--r-- | clang/test/ASTMerge/Inputs/interface2.m | 23 | ||||
-rw-r--r-- | clang/test/ASTMerge/interface.m | 8 |
3 files changed, 54 insertions, 1 deletions
diff --git a/clang/test/ASTMerge/Inputs/interface1.m b/clang/test/ASTMerge/Inputs/interface1.m index ebcd2bbbd9b..bde667475dc 100644 --- a/clang/test/ASTMerge/Inputs/interface1.m +++ b/clang/test/ASTMerge/Inputs/interface1.m @@ -21,3 +21,27 @@ @interface I4 : I2 { } @end + +// Methods match +@interface I5 +- (int)foo; ++ (float)bar; +@end + +// Method mismatch +@interface I6 +- (int)foo; ++ (int)foo; +@end + +// Method mismatch +@interface I7 +- (int)foo; ++ (int)bar:(int)x; +@end + +// Method mismatch +@interface I8 +- (int)foo; ++ (int)bar:(float)x; +@end diff --git a/clang/test/ASTMerge/Inputs/interface2.m b/clang/test/ASTMerge/Inputs/interface2.m index 2e6b0bf2b4e..1d5bebd9969 100644 --- a/clang/test/ASTMerge/Inputs/interface2.m +++ b/clang/test/ASTMerge/Inputs/interface2.m @@ -21,3 +21,26 @@ @interface I4 : I1 { } @end + +// Methods match +@interface I5 ++ (float)bar; +- (int)foo; +@end + +// Method mismatch +@interface I6 ++ (float)foo; +@end + +// Method mismatch +@interface I7 +- (int)foo; ++ (int)bar:(float)x; +@end + +// Method mismatch +@interface I8 +- (int)foo; ++ (int)bar:(float)x, ...; +@end diff --git a/clang/test/ASTMerge/interface.m b/clang/test/ASTMerge/interface.m index ced3fc8981f..465077b4207 100644 --- a/clang/test/ASTMerge/interface.m +++ b/clang/test/ASTMerge/interface.m @@ -7,5 +7,11 @@ // CHECK: interface1.m:21:1: error: class 'I4' has incompatible superclasses // CHECK: interface1.m:21:17: note: inherits from superclass 'I2' here // CHECK: interface2.m:21:17: note: inherits from superclass 'I1' here -// CHECK: 5 diagnostics generated +// CHECK: interface2.m:33:1: error: class method 'foo' has incompatible result types in different translation units ('float' vs. 'int') +// CHECK: interface1.m:34:1: note: class method 'foo' also declared here +// CHECK: interface2.m:39:19: error: class method 'bar:' has a parameter with a different types in different translation units ('float' vs. 'int') +// CHECK: interface1.m:40:17: note: declared here with type 'int' +// CHECK: interface2.m:45:1: error: class method 'bar:' is variadic in one translation unit and not variadic in another +// CHECK: interface1.m:46:1: note: class method 'bar:' also declared here +// CHECK: 11 diagnostics generated |