xref: /aosp_15_r20/external/clang/test/ASTMerge/Inputs/interface1.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// Matches
2*67e74705SXin Li@interface I1 {
3*67e74705SXin Li  int ivar1;
4*67e74705SXin Li}
5*67e74705SXin Li@end
6*67e74705SXin Li
7*67e74705SXin Li// Matches
8*67e74705SXin Li@interface I2 : I1 {
9*67e74705SXin Li  float ivar2;
10*67e74705SXin Li}
11*67e74705SXin Li@end
12*67e74705SXin Li
13*67e74705SXin Li// Ivar mismatch
14*67e74705SXin Li@interface I3 {
15*67e74705SXin Li  int ivar1;
16*67e74705SXin Li  int ivar2;
17*67e74705SXin Li}
18*67e74705SXin Li@end
19*67e74705SXin Li
20*67e74705SXin Li// Superclass mismatch
21*67e74705SXin Li@interface I4 : I2 {
22*67e74705SXin Li}
23*67e74705SXin Li@end
24*67e74705SXin Li
25*67e74705SXin Li// Methods match
26*67e74705SXin Li@interface I5
27*67e74705SXin Li- (int)foo;
28*67e74705SXin Li+ (float)bar;
29*67e74705SXin Li@end
30*67e74705SXin Li
31*67e74705SXin Li// Method mismatch
32*67e74705SXin Li@interface I6
33*67e74705SXin Li- (int)foo;
34*67e74705SXin Li+ (int)foo;
35*67e74705SXin Li@end
36*67e74705SXin Li
37*67e74705SXin Li// Method mismatch
38*67e74705SXin Li@interface I7
39*67e74705SXin Li- (int)foo;
40*67e74705SXin Li+ (int)bar:(int)x;
41*67e74705SXin Li@end
42*67e74705SXin Li
43*67e74705SXin Li// Method mismatch
44*67e74705SXin Li@interface I8
45*67e74705SXin Li- (int)foo;
46*67e74705SXin Li+ (int)bar:(float)x;
47*67e74705SXin Li@end
48*67e74705SXin Li
49*67e74705SXin Li// Matching protocol
50*67e74705SXin Li@protocol P0
51*67e74705SXin Li+ (int)foo;
52*67e74705SXin Li- (int)bar:(float)x;
53*67e74705SXin Li@end
54*67e74705SXin Li
55*67e74705SXin Li// Protocol with mismatching method
56*67e74705SXin Li@protocol P1
57*67e74705SXin Li+ (int)foo;
58*67e74705SXin Li- (int)bar:(float)x;
59*67e74705SXin Li@end
60*67e74705SXin Li
61*67e74705SXin Li// Interface with protocol
62*67e74705SXin Li@interface I9 <P0>
63*67e74705SXin Li+ (int)foo;
64*67e74705SXin Li- (int)bar:(float)x;
65*67e74705SXin Li@end
66*67e74705SXin Li
67*67e74705SXin Li// Protocol with protocol
68*67e74705SXin Li@protocol P2 <P0>
69*67e74705SXin Li- (float)wibble:(int)a1 second:(int)a2;
70*67e74705SXin Li@end
71*67e74705SXin Li
72*67e74705SXin Li// Forward-declared interfaces
73*67e74705SXin Li@class I10, I11;
74*67e74705SXin Li@interface I12
75*67e74705SXin Li@end
76*67e74705SXin Li
77*67e74705SXin Li// Forward-declared protocols
78*67e74705SXin Li@protocol P3, P5;
79*67e74705SXin Li@protocol P4
80*67e74705SXin Li- (double)honk:(int)a;
81*67e74705SXin Li@end
82*67e74705SXin Li
83*67e74705SXin Li// Interface with implementation
84*67e74705SXin Li@interface I13
85*67e74705SXin Li@end
86*67e74705SXin Li
87*67e74705SXin Li@implementation I13
88*67e74705SXin Li@end
89*67e74705SXin Li
90*67e74705SXin Li@interface I13a
91*67e74705SXin Li@end
92*67e74705SXin Li
93*67e74705SXin Li@implementation I13a
94*67e74705SXin Li@end
95*67e74705SXin Li
96*67e74705SXin Li// Implementation by itself
97*67e74705SXin Li@implementation I14 : I12
98*67e74705SXin Li@end
99*67e74705SXin Li
100*67e74705SXin Li@implementation I15 : I12
101*67e74705SXin Li@end
102*67e74705SXin Li
103*67e74705SXin Li
104