From 2e2a400383c7a64a927f61eeed596b08928e1d4b Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 17 Feb 2010 16:12:00 +0000 Subject: AST import for Objective-C protocols git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96478 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/ASTMerge/Inputs/interface1.m | 23 +++++++++++++++++++++++ test/ASTMerge/Inputs/interface2.m | 23 +++++++++++++++++++++++ test/ASTMerge/interface.m | 4 +++- 3 files changed, 49 insertions(+), 1 deletion(-) (limited to 'test/ASTMerge') diff --git a/test/ASTMerge/Inputs/interface1.m b/test/ASTMerge/Inputs/interface1.m index bde667475d..a508bc159b 100644 --- a/test/ASTMerge/Inputs/interface1.m +++ b/test/ASTMerge/Inputs/interface1.m @@ -45,3 +45,26 @@ - (int)foo; + (int)bar:(float)x; @end + +// Matching protocol +@protocol P0 ++ (int)foo; +- (int)bar:(float)x; +@end + +// Protocol with mismatching method +@protocol P1 ++ (int)foo; +- (int)bar:(float)x; +@end + +// Interface with protocol +@interface I9 ++ (int)foo; +- (int)bar:(float)x; +@end + +// Protocol with protocol +@protocol P2 +- (float)wibble:(int)a1 second:(int)a2; +@end diff --git a/test/ASTMerge/Inputs/interface2.m b/test/ASTMerge/Inputs/interface2.m index 1d5bebd996..d79f77d92a 100644 --- a/test/ASTMerge/Inputs/interface2.m +++ b/test/ASTMerge/Inputs/interface2.m @@ -44,3 +44,26 @@ - (int)foo; + (int)bar:(float)x, ...; @end + +// Matching protocol +@protocol P0 ++ (int)foo; +- (int)bar:(float)x; +@end + +// Protocol with mismatching method +@protocol P1 ++ (int)foo; +- (int)bar:(double)x; +@end + +// Interface with protocol +@interface I9 ++ (int)foo; +- (int)bar:(float)x; +@end + +// Protocol with protocol +@protocol P2 +- (float)wibble:(int)a1 second:(int)a2; +@end diff --git a/test/ASTMerge/interface.m b/test/ASTMerge/interface.m index 465077b420..47e4e05269 100644 --- a/test/ASTMerge/interface.m +++ b/test/ASTMerge/interface.m @@ -13,5 +13,7 @@ // 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 +// CHECK: interface2.m:57:20: error: instance method 'bar:' has a parameter with a different types in different translation units ('double' vs. 'float') +// CHECK: interface1.m:58:19: note: declared here with type 'float' +// CHECK: 13 diagnostics generated -- cgit v1.2.3-18-g5258