xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/conflicting-ivar-test-1.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fobjc-runtime=macosx-fragile-10.5 -fsyntax-only -verify -Wno-objc-root-class %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuc@interface INTF
4*f4a2713aSLionel Sambuc{
5*f4a2713aSLionel Sambuc@public
6*f4a2713aSLionel Sambuc	int IVAR; // expected-note {{previous definition is here}}
7*f4a2713aSLionel Sambuc}
8*f4a2713aSLionel Sambuc@end
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambuc@implementation INTF
11*f4a2713aSLionel Sambuc{
12*f4a2713aSLionel Sambuc@private
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambuc        int XIVAR; // expected-error {{conflicting instance variable names: 'XIVAR' vs 'IVAR'}}
15*f4a2713aSLionel Sambuc}
16*f4a2713aSLionel Sambuc@end
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambuc
19*f4a2713aSLionel Sambuc
20*f4a2713aSLionel Sambuc@interface INTF1
21*f4a2713aSLionel Sambuc{
22*f4a2713aSLionel Sambuc@public
23*f4a2713aSLionel Sambuc	int IVAR;
24*f4a2713aSLionel Sambuc	int IVAR1; // expected-error {{inconsistent number of instance variables specified}}
25*f4a2713aSLionel Sambuc}
26*f4a2713aSLionel Sambuc@end
27*f4a2713aSLionel Sambuc
28*f4a2713aSLionel Sambuc@implementation INTF1
29*f4a2713aSLionel Sambuc{
30*f4a2713aSLionel Sambuc@private
31*f4a2713aSLionel Sambuc
32*f4a2713aSLionel Sambuc        int IVAR;
33*f4a2713aSLionel Sambuc}
34*f4a2713aSLionel Sambuc@end
35*f4a2713aSLionel Sambuc
36*f4a2713aSLionel Sambuc
37*f4a2713aSLionel Sambuc@interface INTF2
38*f4a2713aSLionel Sambuc{
39*f4a2713aSLionel Sambuc@public
40*f4a2713aSLionel Sambuc	int IVAR;
41*f4a2713aSLionel Sambuc}
42*f4a2713aSLionel Sambuc@end
43*f4a2713aSLionel Sambuc
44*f4a2713aSLionel Sambuc@implementation INTF2
45*f4a2713aSLionel Sambuc{
46*f4a2713aSLionel Sambuc@private
47*f4a2713aSLionel Sambuc
48*f4a2713aSLionel Sambuc        int IVAR;
49*f4a2713aSLionel Sambuc	int IVAR1; // expected-error {{inconsistent number of instance variables specified}}
50*f4a2713aSLionel Sambuc}
51*f4a2713aSLionel Sambuc@end
52*f4a2713aSLionel Sambuc
53*f4a2713aSLionel Sambuc
54*f4a2713aSLionel Sambuc@interface INTF3
55*f4a2713aSLionel Sambuc{
56*f4a2713aSLionel Sambuc@public
57*f4a2713aSLionel Sambuc	int IVAR; // expected-note {{previous definition is here}}
58*f4a2713aSLionel Sambuc}
59*f4a2713aSLionel Sambuc@end
60*f4a2713aSLionel Sambuc
61*f4a2713aSLionel Sambuc@implementation INTF3
62*f4a2713aSLionel Sambuc{
63*f4a2713aSLionel Sambuc@private
64*f4a2713aSLionel Sambuc
65*f4a2713aSLionel Sambuc        short IVAR; // expected-error {{instance variable 'IVAR' has conflicting type: 'short' vs 'int'}}
66*f4a2713aSLionel Sambuc}
67*f4a2713aSLionel Sambuc@end
68*f4a2713aSLionel Sambuc
69*f4a2713aSLionel Sambuc@implementation  INTF4 // expected-warning {{cannot find interface declaration for 'INTF4'}}
70*f4a2713aSLionel Sambuc{
71*f4a2713aSLionel Sambuc@private
72*f4a2713aSLionel Sambuc
73*f4a2713aSLionel Sambuc        short IVAR;
74*f4a2713aSLionel Sambuc}
75*f4a2713aSLionel Sambuc@end
76*f4a2713aSLionel Sambuc
77*f4a2713aSLionel Sambuc@interface INTF5
78*f4a2713aSLionel Sambuc{
79*f4a2713aSLionel Sambuc  char * ch;
80*f4a2713aSLionel Sambuc}
81*f4a2713aSLionel Sambuc@end
82*f4a2713aSLionel Sambuc
83*f4a2713aSLionel Sambuc@implementation  INTF5
84*f4a2713aSLionel Sambuc{
85*f4a2713aSLionel Sambuc}
86*f4a2713aSLionel Sambuc@end
87