llvm-project
39 строк · 609.0 Байт
1// 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
3// RUN: diff %t %s.result
4
5#define nil (void *)0
6
7@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 {
20if (!(self = [self init])) return nil;
21id a;
22[a init];
23a = [[A alloc] init];
24
25return self;
26}
27
28-(id) init2 {
29if (!(self = [super init])) return nil;
30return self;
31}
32
33-(id) foo {
34[self init];
35[super init];
36
37return self;
38}
39@end
40