blob: d550dedb1dc19145082483d3b824030a197915dc [file] [log] [blame]
John McCall9b0a7ce2011-10-02 01:16:38 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
2// RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
John McCalld70fb982011-06-15 23:25:17 +00003// RUN: diff %t %s.result
John McCalld70fb982011-06-15 23:25:17 +00004
Argyrios Kyrtzidisa9151a52012-03-31 01:34:06 +00005#define nil (void *)0
6
John McCalld70fb982011-06-15 23:25:17 +00007@interface NSObject
8-init;
9@end
10
11@interface A : NSObject
12-init;
13-init2;
14-foo;
15+alloc;
16@end
17
18@implementation A
19-(id) init {
Argyrios Kyrtzidisa9151a52012-03-31 01:34:06 +000020 if (!(self = [self init])) return nil;
John McCalld70fb982011-06-15 23:25:17 +000021 id a;
22 [a init];
23 a = [[A alloc] init];
24
25 return self;
26}
27
28-(id) init2 {
Argyrios Kyrtzidisa9151a52012-03-31 01:34:06 +000029 if (!(self = [super init])) return nil;
John McCalld70fb982011-06-15 23:25:17 +000030 return self;
31}
32
33-(id) foo {
34 [self init];
35 [super init];
36
37 return self;
38}
39@end