blob: d7f730083aabe8120724d6df1a7dfeb3cc6d781f [file] [log] [blame]
John McCalld1e40d52011-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 McCall8f0e8d22011-06-15 23:25:17 +00003// RUN: diff %t %s.result
Argyrios Kyrtzidisd8b42162012-01-12 02:34:32 +00004// DISABLE: mingw32
John McCall8f0e8d22011-06-15 23:25:17 +00005
Argyrios Kyrtzidisd76e1cd2012-03-31 01:34:06 +00006#define nil (void *)0
7
John McCall8f0e8d22011-06-15 23:25:17 +00008@interface NSObject
9-init;
10@end
11
12@interface A : NSObject
13-init;
14-init2;
15-foo;
16+alloc;
17@end
18
19@implementation A
20-(id) init {
Argyrios Kyrtzidisd76e1cd2012-03-31 01:34:06 +000021 if (!(self = [self init])) return nil;
John McCall8f0e8d22011-06-15 23:25:17 +000022 id a;
23 [a init];
24 a = [[A alloc] init];
25
26 return self;
27}
28
29-(id) init2 {
Argyrios Kyrtzidisd76e1cd2012-03-31 01:34:06 +000030 if (!(self = [super init])) return nil;
John McCall8f0e8d22011-06-15 23:25:17 +000031 return self;
32}
33
34-(id) foo {
35 [self init];
36 [super init];
37
38 return self;
39}
40@end